diff --git a/associated-token-account/program/Cargo.toml b/associated-token-account/program/Cargo.toml index ae4706bd..5f27d224 100644 --- a/associated-token-account/program/Cargo.toml +++ b/associated-token-account/program/Cargo.toml @@ -18,7 +18,6 @@ spl-token = { version = "3.1", path = "../../token/program", features = ["no-ent [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/examples/rust/cross-program-invocation/Cargo.toml b/examples/rust/cross-program-invocation/Cargo.toml index f3823a99..3d734c6e 100644 --- a/examples/rust/cross-program-invocation/Cargo.toml +++ b/examples/rust/cross-program-invocation/Cargo.toml @@ -18,7 +18,6 @@ solana-program = "1.5.11" [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/examples/rust/cross-program-invocation/tests/functional.rs b/examples/rust/cross-program-invocation/tests/functional.rs index 1f5406b4..05847047 100644 --- a/examples/rust/cross-program-invocation/tests/functional.rs +++ b/examples/rust/cross-program-invocation/tests/functional.rs @@ -1,16 +1,18 @@ // Mark this test as BPF-only due to current `ProgramTest` limitations when CPIing into the system program #![cfg(feature = "test-bpf")] -use solana_program::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, - rent::Rent, - system_program, +use { + solana_program::{ + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + rent::Rent, + system_program, + }, + solana_program_test::*, + solana_sdk::{account::Account, signature::Signer, transaction::Transaction}, + spl_example_cross_program_invocation::processor::{process_instruction, SIZE}, + std::str::FromStr, }; -use solana_program_test::{processor, ProgramTest}; -use solana_sdk::{account::Account, signature::Signer, transaction::Transaction}; -use spl_example_cross_program_invocation::processor::{process_instruction, SIZE}; -use std::str::FromStr; #[tokio::test] async fn test_cross_program_invocation() { diff --git a/examples/rust/custom-heap/Cargo.toml b/examples/rust/custom-heap/Cargo.toml index fb121ced..a4d406d2 100644 --- a/examples/rust/custom-heap/Cargo.toml +++ b/examples/rust/custom-heap/Cargo.toml @@ -20,7 +20,6 @@ solana-program = "1.5.11" [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/examples/rust/custom-heap/tests/functional.rs b/examples/rust/custom-heap/tests/functional.rs index 8d76d236..7a2cbc23 100644 --- a/examples/rust/custom-heap/tests/functional.rs +++ b/examples/rust/custom-heap/tests/functional.rs @@ -1,8 +1,10 @@ -use solana_program::{instruction::Instruction, pubkey::Pubkey}; -use solana_program_test::{processor, ProgramTest}; -use solana_sdk::{signature::Signer, transaction::Transaction}; -use spl_example_custom_heap::processor::process_instruction; -use std::str::FromStr; +use { + solana_program::{instruction::Instruction, pubkey::Pubkey}, + solana_program_test::*, + solana_sdk::{signature::Signer, transaction::Transaction}, + spl_example_custom_heap::processor::process_instruction, + std::str::FromStr, +}; #[tokio::test] async fn test_custom_heap() { diff --git a/examples/rust/logging/Cargo.toml b/examples/rust/logging/Cargo.toml index 86a5d35d..6070997f 100644 --- a/examples/rust/logging/Cargo.toml +++ b/examples/rust/logging/Cargo.toml @@ -18,7 +18,6 @@ solana-program = "1.5.11" [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/examples/rust/logging/tests/functional.rs b/examples/rust/logging/tests/functional.rs index fb1f18c7..90b82797 100644 --- a/examples/rust/logging/tests/functional.rs +++ b/examples/rust/logging/tests/functional.rs @@ -1,11 +1,13 @@ -use solana_program::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, +use { + solana_program::{ + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + }, + solana_program_test::*, + solana_sdk::{signature::Signer, transaction::Transaction}, + spl_example_logging::processor::process_instruction, + std::str::FromStr, }; -use solana_program_test::{processor, ProgramTest}; -use solana_sdk::{signature::Signer, transaction::Transaction}; -use spl_example_logging::processor::process_instruction; -use std::str::FromStr; #[tokio::test] async fn test_logging() { diff --git a/examples/rust/sysvar/Cargo.toml b/examples/rust/sysvar/Cargo.toml index f3ddd4d9..0f973146 100644 --- a/examples/rust/sysvar/Cargo.toml +++ b/examples/rust/sysvar/Cargo.toml @@ -18,7 +18,6 @@ solana-program = "1.5.11" [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/examples/rust/sysvar/tests/functional.rs b/examples/rust/sysvar/tests/functional.rs index a2c38b31..32082801 100644 --- a/examples/rust/sysvar/tests/functional.rs +++ b/examples/rust/sysvar/tests/functional.rs @@ -1,12 +1,14 @@ -use solana_program::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, - sysvar::{self}, +use { + solana_program::{ + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + sysvar::{self}, + }, + solana_program_test::*, + solana_sdk::{signature::Signer, transaction::Transaction}, + spl_example_sysvar::processor::process_instruction, + std::str::FromStr, }; -use solana_program_test::{processor, ProgramTest}; -use solana_sdk::{signature::Signer, transaction::Transaction}; -use spl_example_sysvar::processor::process_instruction; -use std::str::FromStr; #[tokio::test] async fn test_sysvar() { diff --git a/examples/rust/transfer-lamports/Cargo.toml b/examples/rust/transfer-lamports/Cargo.toml index 357789d1..4c02ca06 100644 --- a/examples/rust/transfer-lamports/Cargo.toml +++ b/examples/rust/transfer-lamports/Cargo.toml @@ -17,7 +17,6 @@ solana-program = "1.5.11" [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/examples/rust/transfer-lamports/tests/functional.rs b/examples/rust/transfer-lamports/tests/functional.rs index 2d597923..3299fd29 100644 --- a/examples/rust/transfer-lamports/tests/functional.rs +++ b/examples/rust/transfer-lamports/tests/functional.rs @@ -1,11 +1,13 @@ -use solana_program::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, +use { + solana_program::{ + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + }, + solana_program_test::*, + solana_sdk::{account::Account, signature::Signer, transaction::Transaction}, + spl_example_transfer_lamports::processor::process_instruction, + std::str::FromStr, }; -use solana_program_test::{processor, ProgramTest}; -use solana_sdk::{account::Account, signature::Signer, transaction::Transaction}; -use spl_example_transfer_lamports::processor::process_instruction; -use std::str::FromStr; #[tokio::test] async fn test_lamport_transfer() { diff --git a/feature-proposal/program/Cargo.toml b/feature-proposal/program/Cargo.toml index 1fda4721..5fde30f3 100644 --- a/feature-proposal/program/Cargo.toml +++ b/feature-proposal/program/Cargo.toml @@ -21,7 +21,6 @@ spl-token = { version = "3.1", path = "../../token/program", features = ["no-ent futures = "0.3" solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/libraries/math/Cargo.toml b/libraries/math/Cargo.toml index 639b6ec5..e8063e91 100644 --- a/libraries/math/Cargo.toml +++ b/libraries/math/Cargo.toml @@ -24,7 +24,6 @@ uint = "0.8" proptest = "0.10" solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/libraries/math/tests/instruction_count.rs b/libraries/math/tests/instruction_count.rs index 2796fc03..0b81e1fc 100644 --- a/libraries/math/tests/instruction_count.rs +++ b/libraries/math/tests/instruction_count.rs @@ -3,7 +3,7 @@ use { solana_program::pubkey::Pubkey, - solana_program_test::{processor, ProgramTest}, + solana_program_test::*, solana_sdk::{signature::Signer, transaction::Transaction}, spl_math::{id, instruction, processor::process_instruction}, }; diff --git a/memo/program/Cargo.toml b/memo/program/Cargo.toml index d8ad104d..e7e1ff85 100644 --- a/memo/program/Cargo.toml +++ b/memo/program/Cargo.toml @@ -17,7 +17,6 @@ solana-program = "1.5.11" [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/patch.crates-io.sh b/patch.crates-io.sh index e46b5704..e89c12dd 100755 --- a/patch.crates-io.sh +++ b/patch.crates-io.sh @@ -26,7 +26,6 @@ cd "$(dirname "$0")" source "$solana_dir"/scripts/read-cargo-variable.sh solana_ver=$(readCargoVariable version "$solana_dir"/sdk/Cargo.toml) -tokio_ver=$(sed -n "s#^tokio.*version *= *\"\([^\"]*\).*#\1#p" "$solana_dir"/program-test/Cargo.toml) echo "Patching in $solana_ver from $solana_dir" echo @@ -57,4 +56,4 @@ PATCH fi done -./update-solana-dependencies.sh "$solana_ver" "$tokio_ver" +./update-solana-dependencies.sh "$solana_ver" diff --git a/record/program/Cargo.toml b/record/program/Cargo.toml index 111e93d8..82acb5da 100644 --- a/record/program/Cargo.toml +++ b/record/program/Cargo.toml @@ -22,7 +22,6 @@ thiserror = "1.0" [dev-dependencies] solana-program-test = "1.5.11" solana-sdk = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/record/program/tests/functional.rs b/record/program/tests/functional.rs index 8a2d8e91..741ec51e 100644 --- a/record/program/tests/functional.rs +++ b/record/program/tests/functional.rs @@ -10,7 +10,7 @@ use { rent::Rent, system_instruction, }, - solana_program_test::{processor, ProgramTest, ProgramTestContext}, + solana_program_test::*, solana_sdk::{ signature::{Keypair, Signer}, transaction::{Transaction, TransactionError}, diff --git a/stake-pool/program/Cargo.toml b/stake-pool/program/Cargo.toml index 5d1f3d5b..9f59d84a 100644 --- a/stake-pool/program/Cargo.toml +++ b/stake-pool/program/Cargo.toml @@ -27,7 +27,6 @@ bincode = "1.3.1" solana-program-test = "1.5.11" solana-sdk = "1.5.11" solana-vote-program = "1.5.11" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/stake-pool/program/tests/deposit.rs b/stake-pool/program/tests/deposit.rs index b1dce30b..b8f4a11f 100644 --- a/stake-pool/program/tests/deposit.rs +++ b/stake-pool/program/tests/deposit.rs @@ -5,7 +5,7 @@ mod helpers; use helpers::*; use solana_program::hash::Hash; -use solana_program_test::BanksClient; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::{Keypair, Signer}, diff --git a/stake-pool/program/tests/initialize.rs b/stake-pool/program/tests/initialize.rs index 79bcaca3..bb0a4da8 100644 --- a/stake-pool/program/tests/initialize.rs +++ b/stake-pool/program/tests/initialize.rs @@ -9,7 +9,7 @@ use solana_program::{ program_pack::Pack, system_instruction, sysvar, }; -use solana_program_test::BanksClient; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::Keypair, signature::Signer, transaction::Transaction, transaction::TransactionError, transport::TransportError, diff --git a/stake-pool/program/tests/set_owner.rs b/stake-pool/program/tests/set_owner.rs index f0897e23..4fa6b3f6 100644 --- a/stake-pool/program/tests/set_owner.rs +++ b/stake-pool/program/tests/set_owner.rs @@ -6,7 +6,7 @@ use helpers::*; use solana_program::hash::Hash; use solana_program::instruction::AccountMeta; use solana_program::instruction::Instruction; -use solana_program_test::BanksClient; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::Keypair, signature::Signer, transaction::Transaction, transaction::TransactionError, transport::TransportError, diff --git a/stake-pool/program/tests/set_staking_authority.rs b/stake-pool/program/tests/set_staking_authority.rs index ab45a88e..d0805284 100644 --- a/stake-pool/program/tests/set_staking_authority.rs +++ b/stake-pool/program/tests/set_staking_authority.rs @@ -8,7 +8,7 @@ use solana_program::hash::Hash; use solana_program::instruction::AccountMeta; use solana_program::instruction::Instruction; use solana_program::sysvar; -use solana_program_test::BanksClient; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::Keypair, signature::Signer, transaction::Transaction, transaction::TransactionError, transport::TransportError, diff --git a/stake-pool/program/tests/update_list_balance.rs b/stake-pool/program/tests/update_list_balance.rs index 259fd497..418699cb 100644 --- a/stake-pool/program/tests/update_list_balance.rs +++ b/stake-pool/program/tests/update_list_balance.rs @@ -6,7 +6,7 @@ use { crate::helpers::TEST_STAKE_AMOUNT, helpers::*, solana_program::{native_token, pubkey::Pubkey}, - solana_program_test::BanksClient, + solana_program_test::*, solana_sdk::signature::Signer, spl_stake_pool::*, }; diff --git a/stake-pool/program/tests/update_pool_balance.rs b/stake-pool/program/tests/update_pool_balance.rs index 53bbd4d6..ff743ced 100644 --- a/stake-pool/program/tests/update_pool_balance.rs +++ b/stake-pool/program/tests/update_pool_balance.rs @@ -3,6 +3,7 @@ mod helpers; use helpers::*; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::Keypair, signature::Signer, transaction::Transaction, transaction::TransactionError, transport::TransportError, diff --git a/stake-pool/program/tests/vsa_add.rs b/stake-pool/program/tests/vsa_add.rs index bd86a6ca..1ac6994c 100644 --- a/stake-pool/program/tests/vsa_add.rs +++ b/stake-pool/program/tests/vsa_add.rs @@ -9,7 +9,7 @@ use solana_program::hash::Hash; use solana_program::instruction::AccountMeta; use solana_program::instruction::Instruction; use solana_program::sysvar; -use solana_program_test::BanksClient; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::{Keypair, Signer}, diff --git a/stake-pool/program/tests/vsa_create.rs b/stake-pool/program/tests/vsa_create.rs index ab48b56e..baad6e65 100644 --- a/stake-pool/program/tests/vsa_create.rs +++ b/stake-pool/program/tests/vsa_create.rs @@ -6,6 +6,7 @@ use crate::solana_program::pubkey::Pubkey; use helpers::*; use bincode::deserialize; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::{Keypair, Signer}, diff --git a/stake-pool/program/tests/vsa_remove.rs b/stake-pool/program/tests/vsa_remove.rs index 61aa3843..b375f608 100644 --- a/stake-pool/program/tests/vsa_remove.rs +++ b/stake-pool/program/tests/vsa_remove.rs @@ -9,7 +9,7 @@ use solana_program::instruction::AccountMeta; use solana_program::instruction::Instruction; use solana_program::pubkey::Pubkey; use solana_program::sysvar; -use solana_program_test::BanksClient; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::{Keypair, Signer}, diff --git a/stake-pool/program/tests/withdraw.rs b/stake-pool/program/tests/withdraw.rs index 17cc7274..925550ea 100644 --- a/stake-pool/program/tests/withdraw.rs +++ b/stake-pool/program/tests/withdraw.rs @@ -6,7 +6,7 @@ use helpers::*; use solana_program::pubkey::Pubkey; use solana_program::hash::Hash; -use solana_program_test::BanksClient; +use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::{Keypair, Signer}, diff --git a/token-lending/program/Cargo.toml b/token-lending/program/Cargo.toml index e87bf5e0..b380377f 100644 --- a/token-lending/program/Cargo.toml +++ b/token-lending/program/Cargo.toml @@ -31,7 +31,6 @@ solana-program-test = "1.5.11" solana-sdk = "1.5.11" serde = "1.0" serde_yaml = "0.8" -tokio = { version = "0.3", features = ["macros"]} [lib] crate-type = ["cdylib", "lib"] diff --git a/token-lending/program/tests/genesis_accounts.rs b/token-lending/program/tests/genesis_accounts.rs index 7c0f27c4..46638836 100644 --- a/token-lending/program/tests/genesis_accounts.rs +++ b/token-lending/program/tests/genesis_accounts.rs @@ -3,6 +3,7 @@ mod helpers; use helpers::*; +use solana_program_test::*; use solana_sdk::signature::Keypair; use spl_token_lending::{ instruction::BorrowAmountType, diff --git a/update-solana-dependencies.sh b/update-solana-dependencies.sh index a0b1dd85..e8b5cf3d 100755 --- a/update-solana-dependencies.sh +++ b/update-solana-dependencies.sh @@ -4,7 +4,6 @@ # solana_ver=$1 -tokio_ver=$2 if [[ -z $solana_ver ]]; then echo "Usage: $0 " exit 1 @@ -37,6 +36,3 @@ set -x for crate in "${crates[@]}"; do sed -i -e "s#\(${crate} = \"\).*\(\"\)#\1$solana_ver\2#g" "${tomls[@]}" done -if [[ -n $tokio_ver ]]; then - sed -i -e "s#\(tokio.*version *= *\"\)[^\"]*\(\".*$\)#\1$tokio_ver\2#g" "${tomls[@]}" -fi