-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix and improve Signer-auth course #527
base: main
Are you sure you want to change the base?
Conversation
replace "init" with "init_if_needed" for vault field in the struct InitializeVault<'info>. delete unnecessary parameters "accounts()" in the test typescript. Update the project repo links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started reviewing this but there were a immediately a bunch of small issues that can be fixed by reading https://github.com/solana-foundation/developer-content/blob/main/CONTRIBUTING.md - see the comments above.
description: | ||
"Ensure instructions are only executed by authorized accounts by implementing | ||
signer checks." | ||
"Ensure instructions are only ran by authorized accounts by implmementing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
```rust | ||
if !ctx.accounts.authority.is_signer { | ||
return Err(ProgramError::MissingRequiredSignature.into()); | ||
return Err(ProgramError::MissingRequiredSignature.into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 spaces per CONTRIBUTING
/// CHECK: This account will not be checked by Anchor | ||
pub authority: UncheckedAccount<'info>, | ||
pub new_authority: AccountInfo<'info>, | ||
pub authority: AccountInfo<'info>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
```rust | ||
```typescript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. This is Rust.
}) | ||
describe("signer-authorization", () => { | ||
... | ||
it("Insecure withdraw should be successful", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See CONTRUBUTING.md re: 'BDD'
This pull request has been automatically marked as stale because it has not had recent activity. Remove stale label or comment or this will be closed in 7 days. |
Problem
The way to get the seed "*ctx.bumps.get("vault").unwrap()" is outdated for the latest anchor version.
Unnecessary parameters in "accounts()" in the test typescript.
Summary of Changes
Update the latest way to get the seed.
replace "init" with "init_if_needed" for vault field in the struct InitializeVault<'info>.
delete unnecessary parameters "accounts()" in the test typescript.
Update the project repo links.