Skip to content

Commit 1b085b0

Browse files
committed
stash sdk for example
1 parent 10d7d99 commit 1b085b0

File tree

24 files changed

+679
-94
lines changed

24 files changed

+679
-94
lines changed

program-libs/account-checks/src/account_iterator.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::{AccountError, AccountInfoTrait};
21
use std::panic::Location;
32

3+
use crate::{AccountError, AccountInfoTrait};
4+
45
/// Iterator over accounts that provides detailed error messages when accounts are missing.
56
///
67
/// This iterator helps with debugging account setup issues by tracking which accounts

program-tests/compressed-token-test/tests/account.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use light_test_utils::{
1212
},
1313
Rpc,
1414
};
15-
1615
use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer};
1716

1817
#[tokio::test]

program-tests/sdk-token-test/tests/test_compress_full_and_close.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async fn test_compress_full_and_close() {
4040
let freeze_authority = Pubkey::new_unique();
4141
let mint_signer = Keypair::new();
4242

43-
let address_tree_pubkey = rpc.get_address_merkle_tree_v2();
43+
let address_tree_pubkey = rpc.get_address_tree_v2().tree;
4444
let output_queue = rpc.get_random_state_tree_info().unwrap().queue;
4545

4646
let compressed_token_program_id =

program-tests/utils/src/assert_close_token_account.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ pub async fn assert_close_token_account<R: Rpc>(
4141
.expect("Compressible account should have extensions")
4242
.iter()
4343
.find_map(|ext| match ext {
44-
light_ctoken_types::state::extensions::ZExtensionStruct::Compressible(comp) => Some(comp),
44+
light_ctoken_types::state::extensions::ZExtensionStruct::Compressible(comp) => {
45+
Some(comp)
46+
}
4547
_ => None,
4648
})
4749
.expect("Should have compressible extension");

program-tests/utils/src/assert_mint_to_compressed.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ use light_client::{
66
};
77
use light_compressed_token::instructions::create_token_pool::find_token_pool_pda_with_index;
88
use light_compressed_token_sdk::instructions::derive_compressed_mint_from_spl_mint;
9-
use light_ctoken_types::{instructions::mint_to_compressed::Recipient, state::CompressedMint, COMPRESSED_TOKEN_PROGRAM_ID};
9+
use light_ctoken_types::{
10+
instructions::mint_to_compressed::Recipient, state::CompressedMint, COMPRESSED_TOKEN_PROGRAM_ID,
11+
};
1012
use solana_sdk::{program_pack::Pack, pubkey::Pubkey};
1113

1214
pub async fn assert_mint_to_compressed<R: Rpc + Indexer>(
@@ -40,7 +42,9 @@ pub async fn assert_mint_to_compressed<R: Rpc + Indexer>(
4042
// Find the token account for this specific mint
4143
let matching_account = token_accounts
4244
.iter()
43-
.find(|account| account.token.mint == spl_mint_pda && account.token.amount == recipient.amount)
45+
.find(|account| {
46+
account.token.mint == spl_mint_pda && account.token.amount == recipient.amount
47+
})
4448
.expect(&format!(
4549
"Recipient {} should have a token account with {} tokens for mint {}",
4650
recipient_pubkey, recipient.amount, spl_mint_pda

program-tests/utils/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ pub mod address_tree_rollover;
2121
pub mod assert_close_token_account;
2222
pub mod assert_compressed_tx;
2323
pub mod assert_create_token_account;
24-
pub mod assert_transfer2;
2524
pub mod assert_epoch;
2625
pub mod assert_merkle_tree;
2726
pub mod assert_mint_to_compressed;
28-
pub mod assert_spl_mint;
2927
pub mod assert_queue;
3028
pub mod assert_rollover;
29+
pub mod assert_spl_mint;
3130
pub mod assert_token_tx;
31+
pub mod assert_transfer2;
3232
pub mod batched_address_tree;
3333
pub mod conversions;
3434
pub mod create_address_test_program_sdk;

programs/compressed-token/program/src/mint_to_compressed/accounts.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ use anchor_lang::solana_program::program_error::ProgramError;
44
use light_account_checks::checks::check_signer;
55
use pinocchio::account_info::AccountInfo;
66

7-
use crate::shared::{accounts::{LightSystemAccounts, UpdateOneCompressedAccountTreeAccounts}, AccountIterator};
7+
use crate::shared::{
8+
accounts::{LightSystemAccounts, UpdateOneCompressedAccountTreeAccounts},
9+
AccountIterator,
10+
};
811

912
pub struct MintToCompressedAccounts<'info> {
1013
pub authority: &'info AccountInfo,

programs/compressed-token/program/src/shared/mint_to_token_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ pub fn mint_to_token_pool(
5656
Ok(()) => Ok(()),
5757
Err(e) => Err(ProgramError::Custom(u64::from(e) as u32)),
5858
}
59-
}
59+
}

programs/compressed-token/program/src/transfer2/native_compression.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ fn process_native_compressions(
5757
token_account_info: &AccountInfo,
5858
packed_accounts: &Transfer2PackedAccounts,
5959
) -> Result<(), ProgramError> {
60-
6160
let mode = compression.mode;
6261

6362
// Validate compression fields for the given mode

programs/compressed-token/program/src/transfer2/processor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ pub fn process_transfer2(
8484
inputs.cpi_context,
8585
)?;
8686

87-
8887
// Process input compressed accounts
8988
set_input_compressed_accounts(
9089
&mut cpi_instruction_struct,

0 commit comments

Comments
 (0)