Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ members = [
"anchor-programs/system",
"sdk-libs/client",
"sdk-libs/token-sdk",
"sdk-libs/compressed-token-sdk",
"sdk-libs/event",
"sdk-libs/token-client",
"sdk-libs/macros",
Expand Down Expand Up @@ -216,6 +217,7 @@ light-compressed-token = { path = "programs/compressed-token/program", version =
] }
light-token-types = { path = "sdk-libs/token-types", version = "0.4.0" }
light-token = { path = "sdk-libs/token-sdk", version = "0.4.0" }
light-compressed-token-sdk = { path = "sdk-libs/compressed-token-sdk", version = "0.1.0" }
light-token-client = { path = "sdk-libs/token-client", version = "0.1.0" }
light-system-program-anchor = { path = "anchor-programs/system", version = "2.0.0", features = [
"cpi",
Expand Down
1 change: 1 addition & 0 deletions forester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ light-compressible = { workspace = true, default-features = false, features = ["
light-token-interface = { workspace = true }
light-token-client = { workspace = true }
light-token = { workspace = true }
light-compressed-token-sdk = { workspace = true }
solana-rpc-client-api = { workspace = true }
solana-transaction-status = { workspace = true }
bb8 = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion forester/src/compressible/ctoken/compressor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use std::{str::FromStr, sync::Arc};
use anchor_lang::{InstructionData, ToAccountMetas};
use forester_utils::rpc_pool::SolanaRpcPool;
use light_client::{indexer::Indexer, rpc::Rpc};
use light_compressed_token_sdk::compressed_token::compress_and_close::CompressAndCloseAccounts as CTokenAccounts;
use light_compressible::config::CompressibleConfig;
use light_registry::{
accounts::CompressAndCloseContext, compressible::compressed_token::CompressAndCloseIndices,
instruction::CompressAndClose,
};
use light_sdk::instruction::PackedAccounts;
use light_token::compressed_token::CompressAndCloseAccounts as CTokenAccounts;
use light_token_interface::LIGHT_TOKEN_PROGRAM_ID;
use solana_sdk::{
instruction::Instruction,
Expand Down
2 changes: 1 addition & 1 deletion forester/tests/test_compressible_ctoken.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use light_client::{
local_test_validator::{spawn_validator, LightValidatorConfig},
rpc::{LightClient, LightClientConfig, Rpc},
};
use light_compressed_token_sdk::compressed_token::create_compressed_mint;
use light_registry::{
protocol_config::state::ProtocolConfigPda,
sdk::{
Expand All @@ -20,7 +21,6 @@ use light_registry::{
utils::{get_forester_pda, get_protocol_config_pda_address},
ForesterConfig,
};
use light_token::compressed_token::create_compressed_mint;
use light_token_client::actions::{
create_compressible_token_account, CreateCompressibleTokenAccountInputs,
};
Expand Down
1 change: 1 addition & 0 deletions program-tests/compressed-token-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ light-token-interface = { workspace = true }
light-token-client = { workspace = true }
light-compressible = { workspace = true }
light-token = { workspace = true }
light-compressed-token-sdk = { workspace = true }
spl-token-2022 = { workspace = true }
spl-pod = { workspace = true }
light-zero-copy = { workspace = true , features = ["std", "derive", "mut"]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ async fn test_compress_and_close_ctoken_with_extensions() {
#[allow(unused_imports)]
use light_client::indexer::CompressedTokenAccount;
use light_client::indexer::Indexer;
use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index;
use light_test_utils::mint_2022::{create_token_22_account, mint_spl_tokens_22};
use light_token::{
instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl},
spl_interface::find_spl_interface_pda_with_index,
};
use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl};
use light_token_client::instructions::transfer2::{
create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! decompressed to the exact same ATA pubkey that was originally compressed.

use light_client::indexer::Indexer;
use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index;
use light_program_test::{
program_test::TestRpc, utils::assert::assert_rpc_error, LightProgramTest, ProgramTestConfig,
};
Expand All @@ -14,12 +15,9 @@ use light_test_utils::{
},
Rpc, RpcError,
};
use light_token::{
instruction::{
derive_token_ata, CompressibleParams, CreateAssociatedTokenAccount, CreateTokenAccount,
TransferFromSpl,
},
spl_interface::find_spl_interface_pda_with_index,
use light_token::instruction::{
derive_token_ata, CompressibleParams, CreateAssociatedTokenAccount, CreateTokenAccount,
TransferFromSpl,
};
use light_token_client::instructions::transfer2::{
create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType,
Expand Down Expand Up @@ -790,10 +788,10 @@ async fn test_decompress_skips_delegate_if_destination_has_delegate() {
async fn test_ata_decompress_with_mismatched_amount_fails() {
use borsh::BorshSerialize;
use light_compressed_account::compressed_account::PackedMerkleContext;
use light_sdk::instruction::PackedAccounts;
use light_token::compressed_token::transfer2::account_metas::{
use light_compressed_token_sdk::compressed_token::transfer2::account_metas::{
get_transfer2_instruction_account_metas, Transfer2AccountsMetaConfig,
};
use light_sdk::instruction::PackedAccounts;
use light_token_interface::{
instructions::transfer2::{
CompressedTokenInstructionDataTransfer2, Compression, CompressionMode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! - Spec #14: CompressedOnly inputs must decompress complete account (no change output)

use light_client::indexer::Indexer;
use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index;
use light_program_test::{
program_test::{LightProgramTest, TestRpc},
utils::assert::assert_rpc_error,
Expand All @@ -14,10 +15,7 @@ use light_test_utils::mint_2022::{
create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22,
RESTRICTED_EXTENSIONS,
};
use light_token::{
instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl},
spl_interface::find_spl_interface_pda_with_index,
};
use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl};
use light_token_client::instructions::transfer2::{
create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use anchor_spl::token_2022::spl_token_2022;
use light_client::indexer::Indexer;
use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index;
use light_program_test::{
program_test::{LightProgramTest, TestRpc},
utils::assert::assert_rpc_error,
Expand All @@ -17,10 +18,7 @@ use light_test_utils::mint_2022::{
create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22,
RESTRICTED_EXTENSIONS,
};
use light_token::{
instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl},
spl_interface::find_spl_interface_pda_with_index,
};
use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl};
use light_token_client::instructions::transfer2::{
create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

use anchor_lang::{system_program, InstructionData, ToAccountMetas};
use light_client::indexer::Indexer;
use light_compressed_token_sdk::{
constants::CPI_AUTHORITY_PDA,
spl_interface::find_spl_interface_pda_with_index as sdk_find_spl_interface_pda,
};
use light_program_test::{
program_test::{LightProgramTest, TestRpc},
utils::assert::assert_rpc_error,
Expand All @@ -17,10 +21,8 @@ use light_program_test::{
use light_test_utils::mint_2022::{
create_token_22_account, mint_spl_tokens_22, set_mint_transfer_fee, set_mint_transfer_hook,
};
use light_token::{
constants::CPI_AUTHORITY_PDA,
instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl, TransferToSpl},
spl_interface::find_spl_interface_pda_with_index as sdk_find_spl_interface_pda,
use light_token::instruction::{
CompressibleParams, CreateTokenAccount, TransferFromSpl, TransferToSpl,
};
use light_token_client::instructions::transfer2::{
create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,8 @@ pub async fn run_compress_and_close_extension_test(
config: CompressAndCloseTestConfig,
) -> Result<(), RpcError> {
use light_client::indexer::Indexer;
use light_token::{
instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl},
spl_interface::find_spl_interface_pda_with_index,
};
use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index;
use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl};
use light_token_client::instructions::transfer2::{
create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@

use borsh::BorshDeserialize;
use light_client::indexer::Indexer;
use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index;
use light_program_test::{program_test::TestRpc, LightProgramTest, ProgramTestConfig};
use light_test_utils::{
mint_2022::{create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22},
Rpc, RpcError,
};
use light_token::{
instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl},
spl_interface::find_spl_interface_pda_with_index,
};
use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl};
use light_token_client::instructions::transfer2::{
create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use light_client::indexer::{CompressedTokenAccount, Indexer};
use light_compressed_token::freeze::sdk::{
create_instruction, CreateInstructionInputs as FreezeInputs,
};
use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index;
use light_program_test::{program_test::TestRpc, LightProgramTest, ProgramTestConfig};
use light_test_utils::{
conversions::sdk_to_program_token_data,
Expand All @@ -19,7 +20,6 @@ use light_test_utils::{
use light_token::{
compat::{AccountState, TokenDataWithMerkleContext},
instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl},
spl_interface::find_spl_interface_pda_with_index,
};
use light_token_client::instructions::transfer2::{
create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType,
Expand Down
6 changes: 2 additions & 4 deletions program-tests/compressed-token-test/tests/light_token/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
//!
//! **Note**: Max top-up exceeded test requires compressible accounts with time warp.
//! For comprehensive max_top_up testing, see sdk-tests/sdk-light-token-test/tests/test_burn.rs
use light_compressed_token_sdk::compressed_token::create_compressed_mint::find_mint_address;
use light_program_test::{
program_test::TestRpc, utils::assert::assert_rpc_error, LightProgramTest, ProgramTestConfig,
};
use light_test_utils::assert_ctoken_burn::assert_ctoken_burn;
use light_token::{
compressed_token::create_compressed_mint::find_mint_address,
instruction::{derive_token_ata, Burn, CreateAssociatedTokenAccount, MintTo},
};
use light_token::instruction::{derive_token_ata, Burn, CreateAssociatedTokenAccount, MintTo};
use light_token_client::instructions::mint_action::DecompressMintParams;

use super::shared::*;
Expand Down
Loading