-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
transfer hook: add new onchain helper #6111
transfer hook: add new onchain helper #6111
Conversation
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
e80383e
to
26ed6f5
Compare
1b717ce
to
dfb7feb
Compare
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.
Looks good! Just a question on the interface for the function
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.
Rolling right along, looks great!
0b076b1
to
269ff6f
Compare
e6238ed
to
b1c626e
Compare
Merge activity
|
269ff6f
to
63e8f91
Compare
b1c626e
to
667b867
Compare
Pull request has been modified.
Continuing on from the new helper introduced in #6111. Here the onchain helper in Token2022 is updated to use the non-deprecated new onchain helper from SPL Transfer Hook interface. PDAs as extra meta configs are also added to the transfer hook test in `program-2022-test` for additional assurance.
As another step for solving #6064, the onchain helpers now need to be
replaced. This PR makes that change in the SPL Transfer Hook interface.
Specifically, this commit adds a new
add_extra_accounts_for_execute_cpi(..)
helper and deprecates the old one.
Like its offchain counterpart, this new helper requires the arguments for
instruction::execute(..)
in order to validate that a properExecuteInstruction
is being resolved, thus ensuring proper account resolution.This function, like its now-deprecated sibling, is designed specifically to add
extra accounts to an
ExecuteInstruction
CPI instruction. It's expected thatthe instruction being provided is a CPI instruction for another program, and
that program will CPI to the transfer hook program in question. Details about
this have been added to the helper's documentation.