-
Notifications
You must be signed in to change notification settings - Fork 165
Add Token2022 Extensions #267
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
Draft
burhankhaja
wants to merge
89
commits into
anza-xyz:main
Choose a base branch
from
Turbin3:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
e159cfd
add test suite
M-Daeva f583062
added token-2022-caller
M-Daeva c31ab58
resolved version conflicts
M-Daeva e8b860c
added token_try_initialize_mint
M-Daeva 6b8a097
fixed initialize_mint
M-Daeva bd09eaf
fixed initialize_mint accounts
M-Daeva 2a4529c
added additional_accounts in token_try_initialize_mint
M-Daeva 386ef6f
added token_try_create_mint_account
M-Daeva be8b271
added token_2022_try_initialize_mint, token_2022_query_mint_state
M-Daeva 3ed586d
added token_2022_proxy_query_mint_state
M-Daeva 2007eb7
fixed naming
M-Daeva d45823e
updated legacy deps
M-Daeva 0b8ef8c
removed unused code, moved test.sh
M-Daeva 683bfa6
updated project structure
M-Daeva 8cd6dc9
added test setup readme
M-Daeva 237ad7f
fixed diagram padding
M-Daeva e11cf60
updated diagram
M-Daeva 16a3c2e
Merge pull request #6 from M-Daeva/mdaeva/tests
zubayr1 8d96727
added Token2022TokenMetadataExtension
M-Daeva e13cbf0
added Token2022TokenGroupExtension
M-Daeva 2dfd19e
fixed token_2022_try_initialize_token_group, token_2022_query_token_g…
M-Daeva 627fad8
updated initialize_group_pointer_with_token_group
M-Daeva 3d27ccf
added group_pointer
M-Daeva ff82098
added group_pointer::initialize
M-Daeva 8ef94ba
fixed initialize_instruction_data
M-Daeva 0eadbd2
added i::group_pointer::update
M-Daeva 47de4c1
fixed initialize_instruction_data
M-Daeva 62bee1a
fixed Update signers type
M-Daeva 10fa4e2
added GroupPointer
M-Daeva 0150044
added GroupPointer::from_account_info checks in initialize
M-Daeva 02c91ce
chaged mod visibility
M-Daeva 3dd1f3f
removed unused code
M-Daeva 34c5d13
removed token group code from group pointer
M-Daeva 63f6e13
added Token2022TokenGroupExtension
M-Daeva 31b2e25
added token_group extension
M-Daeva f6160e2
added InitializeGroup
M-Daeva 82b3d7f
added update_max_size, update_group_authority, initialize_member
M-Daeva 1726095
added group_member_pointer
M-Daeva dc39760
added target selector in test handlers
M-Daeva 0f62b27
added Token2022GroupMemberPointerExtension
M-Daeva 5215890
added token_group_member tests
M-Daeva 14c2b16
added group_member_pointer tests
M-Daeva 4cef8a8
added multisig handlers
M-Daeva 57a8138
Merge pull request #14 from M-Daeva/mdaeva/extensions-0
zubayr1 242addb
added initialize_permanent_delegate
M-Daeva 1e0424c
implemented templates structure
M-Daeva e0efe38
Merge pull request #15 from M-Daeva/mdaeva/permanent-delegate
zubayr1 d008647
add cpi guard invoke call
zubayr1 2c55683
add cpi extension
zubayr1 43911f1
add extension files
zubayr1 8889d3c
add tests
zubayr1 f937cde
fixed ui amount and cpi guards
M-Daeva af13c47
add pausable tests
zubayr1 92be110
add default account state tests
zubayr1 9b28834
feat(extension): add MetadataPointer variant to ExtensionDiscriminato…
burhankhaja a3c2f0d
feat(extension): implement MetadataPointer extension
burhankhaja 4afda89
refactor(extension): expose module in extension scope
burhankhaja 2d460e7
feat(proxy): add metadata_pointer instruction module
burhankhaja ac1178b
chore(proxy): register metadata_pointer instruction in mod.rs
burhankhaja f56b84e
feat(proxy): handle metadata_pointer entrypoint
burhankhaja a675a8e
test(helper): add MetadataPointer test helper module
burhankhaja de116bb
test(metadata): implement MetadataPointer tests
burhankhaja e66cee2
refactor(tests): expose MetadataPointer in lib.rs
burhankhaja ecc8f2d
add transfer hook and interest bearning mint
zubayr1 05a1bdc
fixed tests
M-Daeva 154e049
test(group_pointer): assert Proxy target's state after clearing group…
burhankhaja 4a7812e
Merge pull request #19 from M-Daeva/transfer-hook-and-interest-bearing
zubayr1 6217d7f
feat(extension): add MemoTransfer variant to ExtensionDiscriminator enum
burhankhaja 8e4d669
feat(extension): implement MemoTransfer extension
burhankhaja a117340
chore(extention): expose memo_transfer module in extention scope
burhankhaja 88ba864
tests(helpers): add token_account helper
burhankhaja e772fa7
test(token_account): add SPL & Proxy token_account tests (Proxy test …
burhankhaja 14fdce4
feat(proxy): add token_account proxy code
burhankhaja 4125c8a
feat(proxy): add memo_transfer proxy code
burhankhaja 5dcbc91
test(helpers): add memo_transfer helper code
burhankhaja 178160b
test(memo_transfer): add memo_transfer Target::Spl tests
burhankhaja 485f0f4
test(metadata-pointer) : assert Target::Proxy state in proxy_initiali…
burhankhaja a173b49
fix(test): fix proxy_initialize_and_update_metadata_pointer_with_mult…
burhankhaja 38f2cb6
cleanup: removed obsolete TODO notes from proxy_create_and_initialize…
burhankhaja cf3bf3d
Add files via upload
zubayr1 eac50a0
fix(memo_transfer_proxy): use correct instruction_data index after ex…
burhankhaja 9fbadff
test(memo_transfer): Add complete Target::Proxy tests
burhankhaja 1343dee
Merge pull request #21 from burhankhaja/group-pointer-fix
zubayr1 15242d7
Merge pull request #18 from burhankhaja/metadata-pointer
zubayr1 f9b27fb
Merge branch 'main' into memo-transfer
burhankhaja f684659
Merge pull request #22 from burhankhaja/memo-transfer
zubayr1 32602fd
Merge branch 'main' into zubayr/extensions
burhankhaja e9fe5d5
Merge pull request #9 from Turbin3/zubayr/extensions
burhankhaja d4336f0
Delete EXTENSIONS_STATUS.md
burhankhaja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,215 @@ | ||
| # Pinocchio Interface Test Setup for SPL Token-2022 | ||
|
|
||
| A comprehensive testing framework for validating the Pinocchio interface implementation against the SPL Token-2022 program, enabling developers to contribute confidently to the Pinocchio interface repository. | ||
|
|
||
| ## Problem Statement | ||
|
|
||
| Before this test setup, the Pinocchio interface lacked comprehensive testing coverage, which meant: | ||
|
|
||
| - **Late Error Discovery**: Interface implementation errors were only discovered when used in downstream projects | ||
| - **No Validation Framework**: Contributors had no way to verify their interface implementations worked correctly | ||
| - **Manual Testing Burden**: Developers had to manually construct instructions and test scenarios | ||
| - **Inconsistent Testing**: No standardized approach for testing Cross-Program Invocations (CPI) and state reading functionality | ||
|
|
||
| This test setup solves these problems by providing a complete, automated testing environment that validates both the interface implementation and its real-world usage patterns. | ||
|
|
||
| ## Architecture Overview | ||
|
|
||
|  | ||
|
|
||
| The test setup consists of four main components: | ||
|
|
||
| ### 1. Token-2022 Program | ||
| - **Purpose**: The actual SPL Token-2022 program implementation using Pinocchio interface | ||
| - **Key Features**: | ||
| - Implements token operations via Pinocchio interface | ||
| - Handles state validation and initialization checks | ||
| - Serves as the target program for CPI calls | ||
|
|
||
| ### 2. Token-2022-Proxy Program | ||
| - **Purpose**: Demonstrates real-world usage of Pinocchio interface for CPI calls | ||
| - **Function**: Acts as an intermediary that executes Token-2022 operations through CPI | ||
| - **Why Important**: Simulates how other programs would integrate with Pinocchio interface in production | ||
|
|
||
| ### 3. Target-Based Execution System | ||
| - **Purpose**: Unified system for switching between SPL and Proxy program execution | ||
| - **Benefits**: | ||
| - Single interface for testing both execution paths | ||
| - Eliminates code duplication | ||
| - Provides consistent testing patterns | ||
|
|
||
| ### 4. Test Functions | ||
| - **Design**: Functions that handle both SPL and Proxy execution based on `Target` parameter | ||
| - **Purpose**: Execute Token-2022 operations and query state through either interface | ||
| - **Advantages**: | ||
| - Simplified test creation without manual instruction building | ||
| - Easy state reading using both SPL and Pinocchio interfaces | ||
| - Consistent behavior across different instructions | ||
|
|
||
| ## Code Structure | ||
|
|
||
| ### Target Enum | ||
|
|
||
| The `Target` enum controls which execution path and interface to use: | ||
|
|
||
| ```rust | ||
| /// Switch between SPL and Proxy programs | ||
| pub enum Target { | ||
| /// Execute token-2022 instruction directly, read state using SPL interface | ||
| Spl, | ||
| /// Execute token-2022 instruction using proxy program, read state using Pinocchio interface | ||
| Proxy, | ||
| } | ||
| ``` | ||
|
|
||
| ### Trait Organization | ||
| Each Token-2022 instruction has its own trait with unified handlers: | ||
|
|
||
| ```rust | ||
| pub trait Token2022InitializeMintExtension { | ||
| // Account management | ||
| fn token_2022_try_create_mint_account( | ||
| &mut self, | ||
| sender: AppUser, | ||
| mint: Option<Keypair>, | ||
| extensions: Option<&[ExtensionType]>, | ||
| ) -> TestResult<(TransactionMetadata, Keypair)>; | ||
|
|
||
| // Unified execution (Target determines SPL vs Proxy) | ||
| fn token_2022_try_initialize_mint( | ||
| &mut self, | ||
| target: Target, | ||
| sender: AppUser, | ||
| mint: &Pubkey, | ||
| decimals: u8, | ||
| mint_authority: &Pubkey, | ||
| freeze_authority: Option<&Pubkey>, | ||
| ) -> TestResult<TransactionMetadata>; | ||
|
|
||
| // Unified state reading (Target determines interface) | ||
| fn token_2022_query_mint(&self, target: Target, mint: &Pubkey) -> TestResult<Mint>; | ||
| } | ||
| ``` | ||
|
|
||
| ### Test Categories | ||
|
|
||
| **1. Direct SPL Tests** | ||
| ```rust | ||
| #[test] | ||
| fn initialize_mint() -> TestResult<()> { | ||
| // Tests direct Token-2022 program execution | ||
| app.token_2022_try_initialize_mint(Target::Spl, ...)?; | ||
| assert_eq!(app.token_2022_query_mint(Target::Spl, mint)?, expected_state); | ||
| } | ||
| ``` | ||
|
|
||
| **2. Proxy/CPI Tests** | ||
| ```rust | ||
| #[test] | ||
| fn proxy_initialize_mint() -> TestResult<()> { | ||
| // Tests Pinocchio interface through proxy program | ||
| app.token_2022_try_initialize_mint(Target::Proxy, ...)?; | ||
| assert_eq!(app.token_2022_query_mint(Target::Proxy, mint)?, expected_state); | ||
| } | ||
| ``` | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ### Prerequisites | ||
| - Rust toolchain with Solana program development setup | ||
| - LiteSVM testing environment | ||
|
|
||
| ### Building and Testing | ||
|
|
||
| ```bash | ||
| # Build and test with detailed output | ||
| ./test.sh s | ||
|
|
||
| # Build and test (standard output) | ||
| ./test.sh | ||
| ``` | ||
|
|
||
| ### Adding New Instruction Tests | ||
|
|
||
| 1. **Create a new trait** for your instruction: | ||
| ```rust | ||
| pub trait Token2022YourInstructionExtension { | ||
| fn token_2022_try_your_instruction( | ||
| &mut self, | ||
| target: Target, | ||
| // ... other parameters | ||
| ) -> TestResult<TransactionMetadata>; | ||
|
|
||
| fn token_2022_query_your_state( | ||
| &self, | ||
| target: Target, | ||
| account: &Pubkey, | ||
| ) -> TestResult<YourState>; | ||
| } | ||
| ``` | ||
|
|
||
| 2. **Implement the trait** following the established patterns: | ||
| - Use `Target` to determine execution path and state reading interface | ||
| - Handle both SPL direct execution and proxy CPI calls | ||
| - Implement state query methods for both interfaces | ||
|
|
||
| 3. **Create test file** with both direct and proxy tests: | ||
| - Test the instruction execution with both targets | ||
| - Verify state changes | ||
| - Test error conditions | ||
| - Validate CPI behavior | ||
|
|
||
| ## Testing Strategy | ||
|
|
||
| ### What Gets Tested | ||
|
|
||
| **Interface Correctness** | ||
| - CPI calls work as expected | ||
| - State reading returns correct data | ||
| - Error handling behaves properly | ||
|
|
||
| **Implementation Validation** | ||
| - Pinocchio interface matches SPL interface behavior | ||
| - State structures are correctly mapped | ||
| - Account validation logic is consistent | ||
|
|
||
| **Integration Testing** | ||
| - Proxy programs can successfully call Token-2022 via Pinocchio | ||
| - Cross-program invocations maintain state consistency | ||
| - Complex instruction sequences work correctly | ||
|
|
||
| ### Test Patterns | ||
|
|
||
| 1. **Setup Phase**: Create necessary accounts and initial state | ||
| 2. **Execution Phase**: Test both `Target::Spl` and `Target::Proxy` execution | ||
| 3. **Validation Phase**: Compare state using both SPL and Pinocchio interfaces | ||
| 4. **Edge Cases**: Test error conditions and boundary cases | ||
|
|
||
| ## Contributing | ||
|
|
||
| When contributing to the Pinocchio interface: | ||
|
|
||
| 1. **Add Tests First**: Create comprehensive tests for any new interface implementations | ||
| 2. **Follow Patterns**: Use the established trait and testing patterns with `Target` enum | ||
| 3. **Test Both Paths**: Always test both direct SPL and proxy execution | ||
| 4. **Validate State**: Ensure state reading works correctly through Pinocchio interface | ||
| 5. **Document Edge Cases**: Add tests for error conditions and special cases | ||
|
|
||
| ## Benefits for Contributors | ||
|
|
||
| - **Confidence**: Know your interface implementation works before integration | ||
| - **Fast Feedback**: Catch errors immediately during development | ||
| - **Standardized Testing**: Consistent patterns across all instructions | ||
| - **Real-world Validation**: Test actual CPI usage scenarios | ||
| - **Easy Debugging**: Clear test structure makes issues easy to identify and fix | ||
|
|
||
| ## Future Extensions | ||
|
|
||
| This framework can be extended to test: | ||
| - Additional SPL Token-2022 instructions | ||
| - Token-2022 extensions | ||
| - Complex multi-instruction scenarios | ||
| - Performance characteristics | ||
| - Error recovery patterns | ||
|
|
||
| By using this test setup, contributors can ensure their Pinocchio interface implementations are robust, correct, and ready for production use. | ||
4 changes: 4 additions & 0 deletions
4
cpi-tests/diagrams/pinocchio_cpi_test_setup_architecture.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| [package] | ||
| name = "token-2022-proxy" | ||
| version = "1.0.0" | ||
| description = "A program to test Token-2022 Pinocchio CPI" | ||
| repository = { workspace = true } | ||
| edition = { workspace = true } | ||
| license = { workspace = true } | ||
|
|
||
| [lib] | ||
| crate-type = ["cdylib", "rlib"] | ||
|
|
||
| [features] | ||
| default = [] | ||
| std = [] | ||
|
|
||
| [dependencies] | ||
| pinocchio = { workspace = true } | ||
| pinocchio-log-macro = { workspace = true } | ||
| pinocchio-pubkey = { workspace = true } | ||
| pinocchio-token-2022 = { workspace = true } | ||
| spl-token-group-interface = "0.7.1" | ||
| spl-token-2022-interface = "2.0.0" | ||
| solana-program-option = "3.0.0" | ||
| solana-address = "1.0.0" | ||
| spl-pod = "0.7.1" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| use { | ||
| pinocchio::{log::sol_log, program_error::ProgramError, pubkey::Pubkey}, | ||
| solana_program_option::COption, | ||
| spl_pod::optional_keys::OptionalNonZeroPubkey, | ||
| }; | ||
|
|
||
| pub type Result<T> = core::result::Result<T, ProgramError>; | ||
|
|
||
| pub fn from_c_option<T>(data: COption<T>) -> Option<T> { | ||
| if data.is_some() { | ||
| Some(data.unwrap()) | ||
| } else { | ||
| None | ||
| } | ||
| } | ||
|
|
||
| pub fn from_optional_non_zero_pubkey(address: OptionalNonZeroPubkey) -> Option<Pubkey> { | ||
| Option::<solana_address::Address>::from(address).map(|x| x.to_bytes()) | ||
| } | ||
|
|
||
| pub fn show<T: core::fmt::Debug>(label: &str, data: T) { | ||
| sol_log(&format!("✅ {}: {:?}", label, data)); | ||
| } |
25 changes: 25 additions & 0 deletions
25
cpi-tests/programs/token-2022-proxy/src/instructions/cpi_guard/disable_guard.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| use { | ||
| pinocchio::{account_info::AccountInfo, program_error::ProgramError, ProgramResult}, | ||
| pinocchio_token_2022::extension::cpi_guard, | ||
| }; | ||
|
|
||
| pub fn disable_guard(accounts: &[AccountInfo], _instruction_data: &[u8]) -> ProgramResult { | ||
| // The accounts should be: [account, owner, ...signers, token_program] | ||
|
|
||
| if accounts.len() < 4 { | ||
| Err(ProgramError::NotEnoughAccountKeys)? | ||
| } | ||
|
|
||
| let token_program = accounts.last().unwrap(); // token_program is always last | ||
| let account = &accounts[0]; | ||
| let owner = &accounts[1]; | ||
| let signers = &accounts[2..accounts.len() - 1]; // everything between owner and token_program | ||
|
|
||
| cpi_guard::DisableCpiGuard { | ||
| token_account: account, | ||
| owner, | ||
| signers, | ||
| token_program: &token_program.key(), | ||
| } | ||
| .invoke() | ||
| } |
34 changes: 34 additions & 0 deletions
34
cpi-tests/programs/token-2022-proxy/src/instructions/cpi_guard/enable_guard.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| use { | ||
| pinocchio::{account_info::AccountInfo, program_error::ProgramError, ProgramResult}, | ||
| pinocchio_token_2022::extension::cpi_guard, | ||
| }; | ||
|
|
||
| pub fn enable_guard(accounts: &[AccountInfo], _instruction_data: &[u8]) -> ProgramResult { | ||
| // The accounts should be: [account, owner, ...signers, token_program] | ||
|
|
||
| if accounts.len() < 4 { | ||
| Err(ProgramError::NotEnoughAccountKeys)? | ||
| } | ||
|
|
||
| let token_program = accounts.last().unwrap(); // token_program is always last | ||
| let account = &accounts[0]; | ||
| let owner = &accounts[1]; | ||
| let signers = &accounts[2..accounts.len() - 1]; // everything between owner and token_program | ||
|
|
||
| { | ||
| let acc = account.try_borrow_data()?; | ||
| let state = pinocchio_token_2022::extension::cpi_guard::state::CpiGuard::from_bytes(&acc)?; | ||
|
|
||
| if state.lock_cpi() { | ||
| return Ok(()); | ||
| } | ||
| } | ||
|
|
||
| cpi_guard::EnableCpiGuard { | ||
| token_account: account, | ||
| owner, | ||
| signers, | ||
| token_program: &token_program.key(), | ||
| } | ||
| .invoke() | ||
| } |
5 changes: 5 additions & 0 deletions
5
cpi-tests/programs/token-2022-proxy/src/instructions/cpi_guard/mod.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| mod enable_guard; | ||
| mod disable_guard; | ||
|
|
||
| pub use enable_guard::*; | ||
| pub use disable_guard::*; |
31 changes: 31 additions & 0 deletions
31
cpi-tests/programs/token-2022-proxy/src/instructions/default_account_state/initialize.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| use { | ||
| pinocchio::{account_info::AccountInfo, program_error::ProgramError, ProgramResult}, | ||
| pinocchio_token_2022::extension::default_account_state::instructions::initialize::InitializeDefaultAccountState, | ||
| spl_token_2022_interface::extension::default_account_state::instruction::decode_instruction, | ||
| }; | ||
|
|
||
| pub fn initialize(accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResult { | ||
| let [mint, token_program] = accounts else { | ||
| Err(ProgramError::InvalidAccountData)? | ||
| }; | ||
|
|
||
| let (_, state) = decode_instruction(instruction_data) | ||
| .map_err(|_| ProgramError::InvalidInstructionData)?; | ||
|
|
||
| if pinocchio_token_2022::state::Mint::from_account_info(mint)?.is_initialized() { | ||
| let config = pinocchio_token_2022::extension::default_account_state::state::DefaultAccountStateConfig::from_account_info(mint)?; | ||
|
|
||
| if config.state() != state as u8 { | ||
| Err(ProgramError::InvalidAccountData)? | ||
| } | ||
|
|
||
| return Ok(()); | ||
| } | ||
|
|
||
| InitializeDefaultAccountState { | ||
| mint_account: mint, | ||
| state: state as u8, | ||
| token_program: &token_program.key(), | ||
| } | ||
| .invoke() | ||
| } |
5 changes: 5 additions & 0 deletions
5
cpi-tests/programs/token-2022-proxy/src/instructions/default_account_state/mod.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pub mod initialize; | ||
| pub mod update; | ||
|
|
||
| pub use initialize::*; | ||
| pub use update::*; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
The
cpi-testsshould under thetoken-2022folder since it is specific to it.