Skip to content

Commit 448a641

Browse files
committed
stash
1 parent 27becc5 commit 448a641

File tree

7 files changed

+11
-25
lines changed

7 files changed

+11
-25
lines changed

sdk-libs/compressed-token-sdk/src/cpi/accounts.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use anchor_lang::Key;
21
use light_compressed_token_types::{
32
constants::{
43
ACCOUNT_COMPRESSION_PROGRAM_ID, CPI_AUTHORITY_PDA, LIGHT_SYSTEM_PROGRAM_ID,
@@ -152,7 +151,7 @@ pub fn to_compressed_token_account_metas(
152151
TokenSdkError::CpiError("Missing compress/decompress account".to_string())
153152
})?;
154153
account_metas.push(AccountMeta {
155-
pubkey: account.key(),
154+
pubkey: *account.key,
156155
is_signer: false,
157156
is_writable: false,
158157
});

sdk-libs/compressed-token-sdk/src/cpi/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
//! CPI helpers for compressed token operations
2-
//!
3-
//! This module provides utilities to invoke the compressed token program via cross program invocation (CPI).
4-
//! It follows the same patterns as light-sdk's CPI module.
5-
//!
6-
//! ```ignore
7-
//! let token_account = CTokenAccount::new_empty(recipient, output_tree_index);
8-
//! let cpi_inputs = CpiInputs::new_compress(vec![token_account]);
9-
//!
10-
//! cpi_inputs
11-
//! .invoke_compressed_token_program(light_cpi_accounts)
12-
//! .map_err(ProgramError::from)?;
13-
//! ```
14-
151
pub mod accounts;
162
mod invoke;
173

sdk-libs/compressed-token-sdk/src/instruction/mod.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
pub mod token_accounts;
12

3+
// Re-export all instruction utilities
4+
pub use token_accounts::*;

sdk-libs/compressed-token-sdk/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub mod account;
22
pub mod cpi;
33
pub mod error;
4-
pub mod instruction;
4+
pub mod instructions;
55
pub mod token_pool;
66

77
pub use light_compressed_token_types::*;

sdk-libs/compressed-token-sdk/tests/account_metas_test.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ fn test_to_compressed_token_account_metas_compress() {
4444
let mut system_program_account = TestAccount::new(system_program, Pubkey::default(), 0);
4545

4646
let fee_payer_info = fee_payer_account.get_account_info();
47+
let authority_info = authority_account.get_account_info();
4748

4849
// Create account infos in the correct order for CpiAccounts
4950
let account_infos = vec![
5051
light_system_account.get_account_info(), // 0: light_system_program
51-
authority_account.get_account_info(), // 1: authority
52+
authority_info.clone(), // 1: authority
5253
registered_program_account.get_account_info(), // 2: registered_program_pda
5354
noop_account.get_account_info(), // 3: noop_program
5455
compression_authority_account.get_account_info(), // 4: account_compression_authority
@@ -75,7 +76,7 @@ fn test_to_compressed_token_account_metas_compress() {
7576
// Create CpiAccounts with default config (no optional accounts)
7677
let config = CpiAccountsConfig::default();
7778
let cpi_accounts =
78-
CpiAccounts::new_with_config(&fee_payer_info, &authority, &account_infos, config);
79+
CpiAccounts::new_with_config(&fee_payer_info, &authority_info, &account_infos, config);
7980

8081
// Test our function
8182
let result = to_compressed_token_account_metas(&cpi_accounts);
@@ -134,11 +135,12 @@ fn test_to_compressed_token_account_metas_with_optional_accounts() {
134135
let mut token_program_ctx_account = TestAccount::new(token_program, Pubkey::default(), 0);
135136

136137
let fee_payer_info = fee_payer_account.get_account_info();
138+
let authority_info = authority_account.get_account_info();
137139

138140
// Create account infos in the correct order for CpiAccounts with all optional accounts
139141
let account_infos = vec![
140142
light_system_account.get_account_info(), // 0: light_system_program
141-
authority_account.get_account_info(), // 1: authority
143+
authority_info.clone(), // 1: authority
142144
registered_program_account.get_account_info(), // 2: registered_program_pda
143145
noop_account.get_account_info(), // 3: noop_program
144146
compression_authority_account.get_account_info(), // 4: account_compression_authority
@@ -173,7 +175,7 @@ fn test_to_compressed_token_account_metas_with_optional_accounts() {
173175
decompress: false,
174176
};
175177
let cpi_accounts =
176-
CpiAccounts::new_with_config(&fee_payer_info, &authority, &account_infos, config);
178+
CpiAccounts::new_with_config(&fee_payer_info, &authority_info, &account_infos, config);
177179

178180
// Test our function
179181
let result = to_compressed_token_account_metas(&cpi_accounts);

0 commit comments

Comments
 (0)