diff --git a/program-tests/compressed-token-test/tests/light_token/extensions_failing.rs b/program-tests/compressed-token-test/tests/light_token/extensions_failing.rs index 9291e7facf..7b70820bc4 100644 --- a/program-tests/compressed-token-test/tests/light_token/extensions_failing.rs +++ b/program-tests/compressed-token-test/tests/light_token/extensions_failing.rs @@ -412,8 +412,8 @@ async fn test_spl_to_ctoken_fails_when_mint_paused() { .rpc .create_and_send_transaction(&[transfer_ix], &payer.pubkey(), &[&payer]) .await; - // fails because of token 2022 check Transferring, minting, and burning is paused on this mint - assert_rpc_error(result, 0, 67).unwrap(); + // Fails in Light Token program with MintPaused (6127) before SPL transfer + assert_rpc_error(result, 0, 6127).unwrap(); println!("Correctly rejected SPL→Light Token when mint is paused"); } diff --git a/program-tests/compressed-token-test/tests/token_pool.rs b/program-tests/compressed-token-test/tests/token_pool.rs index 46ab70219b..36fe4ade03 100644 --- a/program-tests/compressed-token-test/tests/token_pool.rs +++ b/program-tests/compressed-token-test/tests/token_pool.rs @@ -378,8 +378,8 @@ async fn failing_tests_add_token_pool() { ) .unwrap(); } - // 4. failing invalid mint - now fails with ConstraintSeeds because mint validation - // happens after PDA derivation (mint changed from InterfaceAccount to AccountInfo) + // 4. failing invalid mint - fails with InvalidMint because restricted_seed() is called + // in the seeds constraint and tries to parse mint data before PDA derivation check { let result = add_token_pool( &mut rpc, @@ -391,12 +391,7 @@ async fn failing_tests_add_token_pool() { FailingTestsAddTokenPool::InvalidMint, ) .await; - assert_rpc_error( - result, - 0, - anchor_lang::error::ErrorCode::ConstraintSeeds.into(), - ) - .unwrap(); + assert_rpc_error(result, 0, ErrorCode::InvalidMint.into()).unwrap(); } // 5. failing inconsistent mints { diff --git a/program-tests/justfile b/program-tests/justfile index b63c5fcdaa..b305eec372 100644 --- a/program-tests/justfile +++ b/program-tests/justfile @@ -52,7 +52,7 @@ test-system-cpi-v2-functional-account-infos: RUSTFLAGS="-D warnings" cargo test-sbf -p system-cpi-v2-test -- functional_account_infos # Compressed token tests -test-compressed-token: test-compressed-token-unit test-compressed-token-v1 test-compressed-token-mint test-compressed-token-light-token test-compressed-token-transfer2 +test-compressed-token: test-compressed-token-unit test-compressed-token-v1 test-compressed-token-mint test-compressed-token-light-token test-compressed-token-transfer2 test-compressed-token-token-pool test-compressed-token-unit: RUSTFLAGS="-D warnings" cargo test -p light-compressed-token @@ -69,6 +69,9 @@ test-compressed-token-light-token: test-compressed-token-transfer2: RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test --test transfer2 +test-compressed-token-token-pool: + RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test --test token_pool + # Compressed token batched tree test (flaky, may need retries) test-compressed-token-batched-tree: RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test -- test_transfer_with_photon_and_batched_tree @@ -102,7 +105,7 @@ ci-system-address: test-system-address test-e2e test-e2e-extended test-compresse ci-system-compression: test-system-compression test-system-re-init # Matches CI: compressed-token-and-e2e -ci-compressed-token-and-e2e: test-compressed-token-unit test-compressed-token-v1 test-compressed-token-mint +ci-compressed-token-and-e2e: test-compressed-token-unit test-compressed-token-v1 test-compressed-token-mint test-compressed-token-token-pool # Matches CI: compressed-token-batched-tree (with retry for flaky test) ci-compressed-token-batched-tree: diff --git a/programs/compressed-token/program/src/compressed_token/transfer2/compression/mod.rs b/programs/compressed-token/program/src/compressed_token/transfer2/compression/mod.rs index 95e1beb9cf..41031ee92d 100644 --- a/programs/compressed-token/program/src/compressed_token/transfer2/compression/mod.rs +++ b/programs/compressed-token/program/src/compressed_token/transfer2/compression/mod.rs @@ -132,6 +132,12 @@ pub fn process_token_compression<'a>( return Err(ErrorCode::CompressedOnlyRequiresCTokenDecompress.into()); } + // Enforce extension state for SPL compress (paused, non-zero fees, non-nil hook). + // Decompress bypasses because it's exiting compressed state. + if compression.mode.is_compress() { + mint_checks.enforce_extension_state()?; + } + // Propagate whether mint is restricted to enable correct derivation of the spl interface pda. let is_restricted = mint_checks.has_restricted_extensions; spl::process_spl_compressions(