diff --git a/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/programs/abl-token/Cargo.toml b/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/programs/abl-token/Cargo.toml index 1046b6e1c..9099c0718 100644 --- a/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/programs/abl-token/Cargo.toml +++ b/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/programs/abl-token/Cargo.toml @@ -33,6 +33,15 @@ spl-transfer-hook-interface = { version = "2.1.0" } spl-discriminator = "0.5.1" [dev-dependencies] +litesvm = "0.11.0" +solana-instruction = "3.0.0" +solana-keypair = "3.0.1" +solana-message = "3.1.0" +solana-native-token = "3.0.0" +solana-pubkey = "3.0.0" +solana-sdk-ids = "3.0.0" +solana-signer = "3.0.0" +solana-transaction = "3.0.1" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/tests-rs/test.rs b/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/programs/abl-token/tests/test.rs similarity index 86% rename from tokens/token-2022/transfer-hook/allow-block-list-token/anchor/tests-rs/test.rs rename to tokens/token-2022/transfer-hook/allow-block-list-token/anchor/programs/abl-token/tests/test.rs index 17194a6f5..67d68661e 100644 --- a/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/tests-rs/test.rs +++ b/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/programs/abl-token/tests/test.rs @@ -1,23 +1,17 @@ -// TODO: Move this test back to programs/abl-token/tests/test.rs once the litesvm -// version gap is resolved. Currently litesvm <=0.6 pins solana-account-info to -// =2.2.1, but anchor-lang 0.32.1 needs >=2.3.0 (for AccountInfo::resize). -// litesvm 0.9+ uses solana 3.x which has type mismatches with anchor-lang's v2 types. -// This will resolve when anchor-lang upgrades to solana 3.x (likely anchor 0.33+). - use { abl_token::{accounts::InitConfig, accounts::InitMint, instructions::InitMintArgs, Mode}, anchor_lang::InstructionData, anchor_lang::ToAccountMetas, + anchor_spl::token_2022::ID as TOKEN_22_PROGRAM_ID, litesvm::LiteSVM, solana_instruction::Instruction, solana_keypair::Keypair, solana_message::Message, solana_native_token::LAMPORTS_PER_SOL, - solana_pubkey::{pubkey, Pubkey}, + solana_pubkey::Pubkey, solana_sdk_ids::system_program::ID as SYSTEM_PROGRAM_ID, solana_signer::Signer, solana_transaction::Transaction, - spl_token_2022::ID as TOKEN_22_PROGRAM_ID, std::path::PathBuf, }; diff --git a/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/tests-rs/README.md b/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/tests-rs/README.md deleted file mode 100644 index 4305f3c1b..000000000 --- a/tokens/token-2022/transfer-hook/allow-block-list-token/anchor/tests-rs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Temporarily relocated Rust tests - -`test.rs` was moved here from `programs/abl-token/tests/test.rs` because it -cannot currently compile alongside anchor-lang 0.32.1. - -## Why - -The test uses **litesvm**, which pins `solana-account-info` to an exact 2.2.x -version. However, anchor-lang 0.32.1 requires `solana-account-info >=2.3.0` -for the `AccountInfo::resize()` method (renamed from `realloc` in 2.3.0). - -This creates an unresolvable dependency conflict: - -- **litesvm <=0.6** → pins `solana-account-info =2.2.1` (too old, no `resize()`) -- **litesvm 0.9+** → uses `solana-account-info 3.x` (type mismatch with anchor-lang's 2.x types) - -No litesvm release currently targets the `solana-account-info 2.3+` range -that anchor-lang 0.32.1 needs. - -## When to move it back - -Move `test.rs` back to `programs/abl-token/tests/test.rs` and restore the -`[dev-dependencies]` in `Cargo.toml` when **either**: - -1. **anchor-lang upgrades to solana 3.x** (likely 0.33+), so litesvm 0.9+ types match, or -2. **litesvm releases a version** targeting `solana-account-info >=2.3, <3`