-
Notifications
You must be signed in to change notification settings - Fork 200
program: let anotehr signer deposit on user behalf #1891
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
base: master
Are you sure you want to change the base?
program: let anotehr signer deposit on user behalf #1891
Conversation
| let signer = if ctx.accounts.authority.key() == user.authority { | ||
| Some(ctx.accounts.authority.key()) | ||
| } else { | ||
| None |
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.
should this just always be ctx.accounts.authority? i guess that would make all events larger
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.
prefer keeping it None for normal deposit to match historical schema
| } else { | ||
| DepositExplanation::None | ||
| }; | ||
| let signer = if ctx.accounts.authority.key() == user.authority { |
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 think you want to flip this and log if it's a third party making the deposit?
| let signer = if ctx.accounts.authority.key() == user.authority { | |
| let signer = if ctx.accounts.authority.key() != user.authority { |
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.
should this be a newly named instruction to lower chance of accidental deposit into wrong account?
No description provided.