Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
InitializeAccount2struct tointerface/src/token.rswith
discriminant(u8) andproprietor(Address) fields,and inject its discriminant, account count, and seed count
constants into
common/token.srentpointer andinitialize_account_2_datafields toRegisterMarketFrame, with correspondingRENT,INIT_ACCT_2_DATA,INIT_ACCT_2_DISC, andINIT_ACCT_2_PROPRIETORconstant group entriesREGISTER-MARKET parsing (after address validation)
CreateAccount, setting up vault (writable), mint (readonly),
and Rent sysvar (readonly) as CPI accounts, with the market
PDA address as the token account proprietor
cpi[2]is_signer/is_writable preconditions toINIT-VAULT (zero-initialized, never modified)
InitializeAccount2tosize_of_group!ininterface/src/memory.rscheck_vault!test macro to unpack and verify tokenaccount fields (mint, proprietor, amount, state) using
spl_token_interface::state::AccountTransferFeeConfig,TransferHook) to happy path tests so the two vaults inthe all-2022 case have different
GetAccountDataSizeresultsspl-token-2022-interfaceandsolana-program-packworkspace dependencies for extension types and Pack trait
discriminatortodiscriminantacross interface,assembly, and docs for consistency