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
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
11 changes: 3 additions & 8 deletions program-tests/compressed-token-test/tests/token_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
{
Expand Down
7 changes: 5 additions & 2 deletions program-tests/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down