Skip to content

Commit

Permalink
Remove tokio dev-dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Mar 17, 2021
1 parent c63d854 commit 995d4a0
Show file tree
Hide file tree
Showing 32 changed files with 60 additions and 64 deletions.
1 change: 0 additions & 1 deletion associated-token-account/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
1 change: 0 additions & 1 deletion examples/rust/cross-program-invocation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
20 changes: 11 additions & 9 deletions examples/rust/cross-program-invocation/tests/functional.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
1 change: 0 additions & 1 deletion examples/rust/custom-heap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
12 changes: 7 additions & 5 deletions examples/rust/custom-heap/tests/functional.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
1 change: 0 additions & 1 deletion examples/rust/logging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
16 changes: 9 additions & 7 deletions examples/rust/logging/tests/functional.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
1 change: 0 additions & 1 deletion examples/rust/sysvar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
18 changes: 10 additions & 8 deletions examples/rust/sysvar/tests/functional.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
1 change: 0 additions & 1 deletion examples/rust/transfer-lamports/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
16 changes: 9 additions & 7 deletions examples/rust/transfer-lamports/tests/functional.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
1 change: 0 additions & 1 deletion feature-proposal/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
1 change: 0 additions & 1 deletion libraries/math/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion libraries/math/tests/instruction_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};
Expand Down
1 change: 0 additions & 1 deletion memo/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
3 changes: 1 addition & 2 deletions patch.crates-io.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -57,4 +56,4 @@ PATCH
fi
done

./update-solana-dependencies.sh "$solana_ver" "$tokio_ver"
./update-solana-dependencies.sh "$solana_ver"
1 change: 0 additions & 1 deletion record/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion record/program/tests/functional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
1 change: 0 additions & 1 deletion stake-pool/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion stake-pool/program/tests/deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/program/tests/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/program/tests/set_owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/program/tests/set_staking_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/program/tests/update_list_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*,
};
Expand Down
1 change: 1 addition & 0 deletions stake-pool/program/tests/update_pool_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/program/tests/vsa_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
1 change: 1 addition & 0 deletions stake-pool/program/tests/vsa_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/program/tests/vsa_remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/program/tests/withdraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
1 change: 0 additions & 1 deletion token-lending/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
1 change: 1 addition & 0 deletions token-lending/program/tests/genesis_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
mod helpers;

use helpers::*;
use solana_program_test::*;
use solana_sdk::signature::Keypair;
use spl_token_lending::{
instruction::BorrowAmountType,
Expand Down
4 changes: 0 additions & 4 deletions update-solana-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#

solana_ver=$1
tokio_ver=$2
if [[ -z $solana_ver ]]; then
echo "Usage: $0 <new-solana-version>"
exit 1
Expand Down Expand Up @@ -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

0 comments on commit 995d4a0

Please sign in to comment.