Skip to content

Commit aaa6ea8

Browse files
committed
fix: update simple-claim for light-token v0.3 API changes
- Enable v1 feature for backward compatible API - Fix module paths (v1 contents are re-exported directly) - Rename CTokenSdkError to TokenSdkError - Add restricted param to derive_spl_interface_pda - Use light_token::instruction::id() for program ID
1 parent 8158784 commit aaa6ea8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

airdrop-implementations/simple-claim/program/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ solana-program = "2.3"
1919
thiserror = "2.0.11"
2020
borsh = "0.10.0"
2121
light-compressed-account = "0.8.0"
22-
light-token = "0.3"
22+
light-token = { version = "0.3", features = ["v1"] }
2323
light-sdk = "0.18.0"
2424
spl-token = { version = "5.0.0", features = ["no-entrypoint"] }
2525

airdrop-implementations/simple-claim/program/src/instruction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ pub fn compress(
139139
recipient: Pubkey,
140140
merkle_tree: Pubkey,
141141
token_program_id: Pubkey,
142-
) -> Result<Instruction, light_token::error::CTokenSdkError> {
143-
let spl_interface_info = derive_spl_interface_pda(&mint, 0);
142+
) -> Result<Instruction, light_token::error::TokenSdkError> {
143+
let spl_interface_info = derive_spl_interface_pda(&mint, 0, false);
144144

145145
let inputs = BatchCompressInputs {
146146
fee_payer,

airdrop-implementations/simple-claim/program/src/processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn process_claim(accounts: &[AccountInfo], ix_data: ClaimIxData) -> ProgramResul
6666
return Err(ProgramError::MissingRequiredSignature);
6767
}
6868
// CHECK:
69-
if ctoken_program_info.key != &light_token::ctoken::id() {
69+
if ctoken_program_info.key != &light_token::instruction::id() {
7070
msg!("Invalid compressed token program.",);
7171
ctoken_program_info.key.log();
7272
return Err(ProgramError::InvalidArgument);

0 commit comments

Comments
 (0)