Skip to content

Commit 0df84a4

Browse files
fix MintActionCompressedInstructionData
1 parent ba678ff commit 0df84a4

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

program-libs/ctoken-types/src/instructions/mint_action/instruction_data.rs

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use crate::{
1111
state::{BaseCompressedMint, CompressedMint, ExtensionStruct},
1212
AnchorDeserialize, AnchorSerialize, CTokenError,
1313
};
14+
use light_compressed_account::Pubkey;
1415

1516
#[repr(C)]
1617
#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize, ZeroCopy)]
@@ -49,13 +50,13 @@ pub struct MintActionCompressedInstructionData {
4950
/// If proof by index not used.
5051
pub root_index: u16,
5152
pub compressed_address: [u8; 32],
53+
/// If some -> no input because we create mint
54+
pub mint: CompressedMintInstructionData,
5255
pub token_pool_bump: u8,
5356
pub token_pool_index: u8,
5457
pub actions: Vec<Action>,
5558
pub proof: Option<CompressedProof>,
5659
pub cpi_context: Option<CpiContext>,
57-
/// If some -> no input because we create mint
58-
pub mint: CompressedMintInstructionData,
5960
}
6061

6162
#[repr(C)]
@@ -83,13 +84,15 @@ impl CompressedMintWithContext {
8384
root_index,
8485
address: compressed_address,
8586
mint: CompressedMintInstructionData {
86-
version: 0,
87-
spl_mint,
88-
supply: 0, // TODO: dynamic?
89-
decimals,
90-
is_decompressed: false,
91-
mint_authority,
92-
freeze_authority,
87+
base: BaseCompressedMint {
88+
version: 0,
89+
spl_mint,
90+
supply: 0, // TODO: dynamic?
91+
decimals,
92+
is_decompressed: false,
93+
mint_authority,
94+
freeze_authority,
95+
},
9396
extensions: None,
9497
},
9598
}
@@ -110,13 +113,15 @@ impl CompressedMintWithContext {
110113
root_index,
111114
address: compressed_address,
112115
mint: CompressedMintInstructionData {
113-
version: 0,
114-
spl_mint,
115-
supply: 0,
116-
decimals,
117-
is_decompressed: false,
118-
mint_authority,
119-
freeze_authority,
116+
base: BaseCompressedMint {
117+
version: 0,
118+
spl_mint,
119+
supply: 0, // TODO: dynamic?
120+
decimals,
121+
is_decompressed: false,
122+
mint_authority,
123+
freeze_authority,
124+
},
120125
extensions,
121126
},
122127
}

sdk-tests/anchor-compressible/tests/test_decompress_multiple.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use light_compressed_token_sdk::{
1515
use light_compressible_client::CompressibleInstruction;
1616
use light_ctoken_types::{
1717
instructions::mint_action::{CompressedMintInstructionData, CompressedMintWithContext},
18+
state::BaseCompressedMint,
1819
COMPRESSED_TOKEN_PROGRAM_ID,
1920
};
2021
use light_macros::pubkey;
@@ -1458,14 +1459,16 @@ async fn create_user_record_and_game_session(
14581459
root_index: mint_address_tree_info.root_index,
14591460
address: compressed_mint_address,
14601461
mint: CompressedMintInstructionData {
1461-
version: 1,
1462-
spl_mint: spl_mint.into(),
1463-
supply: 0,
1464-
decimals,
1465-
mint_authority: Some(mint_authority.into()),
1466-
freeze_authority: Some(freeze_authority.into()),
1462+
base: BaseCompressedMint {
1463+
version: 1,
1464+
spl_mint: spl_mint.into(),
1465+
supply: 0,
1466+
decimals,
1467+
mint_authority: Some(mint_authority.into()),
1468+
freeze_authority: Some(freeze_authority.into()),
1469+
is_decompressed: false,
1470+
},
14671471
extensions: None,
1468-
is_decompressed: false,
14691472
},
14701473
},
14711474
},

0 commit comments

Comments
 (0)