diff --git a/.release-plz.toml b/.release-plz.toml index 9e21e34..b3cbf45 100644 --- a/.release-plz.toml +++ b/.release-plz.toml @@ -28,6 +28,10 @@ changelog_path = "crates/memory_wallet/changelog.md" name = "test_utils_insta" changelog_path = "crates/test_utils_insta/changelog.md" +[[package]] +name = "test_utils_keypairs" +changelog_path = "crates/test_utils_keypairs/changelog.md" + [[package]] name = "test_utils_solana" changelog_path = "crates/test_utils_solana/changelog.md" diff --git a/Cargo.lock b/Cargo.lock index 888a0bc..506687c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1919,6 +1919,7 @@ dependencies = [ "test-log", "test_utils_anchor", "test_utils_insta", + "test_utils_keypairs", "test_utils_solana", "tokio", "typed-builder", @@ -3553,6 +3554,7 @@ dependencies = [ "solana-sdk", "test-log", "test_utils_insta", + "test_utils_keypairs", "test_utils_solana", "tokio", "typed-builder", @@ -8854,6 +8856,13 @@ dependencies = [ "insta", ] +[[package]] +name = "test_utils_keypairs" +version = "0.1.0" +dependencies = [ + "solana-sdk", +] + [[package]] name = "test_utils_solana" version = "0.6.1" @@ -8889,6 +8898,7 @@ dependencies = [ "tarpc", "test-log", "test_utils_insta", + "test_utils_keypairs", "tokio", "typed-builder", "wallet_standard", @@ -9837,7 +9847,7 @@ dependencies = [ "spl-token-metadata-interface 0.6.0", "test-log", "test_utils_insta", - "test_utils_solana", + "test_utils_keypairs", "thiserror 2.0.6", "tokio", "typed-builder", diff --git a/Cargo.toml b/Cargo.toml index bb7edab..ce43a6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,11 +91,12 @@ zstd = { version = "0.13", default-features = false } # internal crates example_client = { path = "./programs/example_client" } example_program = { path = "./programs/example_program" } -test_utils_insta = { path = "./crates/test_utils_insta" } # publishable crates memory_wallet = { path = "./crates/memory_wallet", version = "0.1.16" } test_utils_anchor = { path = "./crates/test_utils_anchor" } +test_utils_insta = { path = "./crates/test_utils_insta", version = "0.1.0" } +test_utils_keypairs = { path = "./crates/test_utils_keypairs", version = "0.1.0" } test_utils_solana = { path = "./crates/test_utils_solana", version = "0.6.1" } wasm_client_anchor = { path = "./crates/wasm_client_anchor", version = "0.8.0" } wasm_client_solana = { path = "./crates/wasm_client_solana", version = "0.7.0" } diff --git a/crates/memory_wallet/Cargo.toml b/crates/memory_wallet/Cargo.toml index ff92f65..90e3490 100644 --- a/crates/memory_wallet/Cargo.toml +++ b/crates/memory_wallet/Cargo.toml @@ -31,6 +31,7 @@ anyhow = { workspace = true } assert2 = { workspace = true } test-log = { workspace = true, features = ["trace"] } test_utils_insta = { workspace = true } +test_utils_keypairs = { workspace = true } test_utils_solana = { workspace = true, features = ["test_validator"] } tokio = { workspace = true, features = ["test-util"] } diff --git a/crates/memory_wallet/tests/memory.rs b/crates/memory_wallet/tests/memory.rs index 0b095ee..baeaf04 100644 --- a/crates/memory_wallet/tests/memory.rs +++ b/crates/memory_wallet/tests/memory.rs @@ -12,7 +12,7 @@ use solana_sdk::signature::Signature; use solana_sdk::system_instruction::transfer; use solana_sdk::transaction::VersionedTransaction; use test_log::test; -use test_utils_solana::get_wallet_keypair; +use test_utils_keypairs::get_wallet_keypair; use test_utils_solana::prelude::*; use test_utils_solana::ProgramTest; use test_utils_solana::ProgramTestContext; diff --git a/crates/test_utils_keypairs/Cargo.toml b/crates/test_utils_keypairs/Cargo.toml new file mode 100644 index 0000000..4e131ae --- /dev/null +++ b/crates/test_utils_keypairs/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "test_utils_keypairs" +version = "0.1.0" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = "readme.md" +repository = { workspace = true } +rust-version = { workspace = true } +description = "Test utils to make working with pre defined keypairs easier." + +[dependencies] +solana-sdk = { workspace = true } + +[lints] +workspace = true diff --git a/crates/test_utils_keypairs/readme.md b/crates/test_utils_keypairs/readme.md new file mode 100644 index 0000000..6432d82 --- /dev/null +++ b/crates/test_utils_keypairs/readme.md @@ -0,0 +1,9 @@ +# test_utils_keypairs + +> Test utils to make working with pre defined keypairs easier. + +## Usage + +```rust +use test_utils_keypairs::*; +``` diff --git a/crates/test_utils_solana/src/keypairs.rs b/crates/test_utils_keypairs/src/lib.rs similarity index 100% rename from crates/test_utils_solana/src/keypairs.rs rename to crates/test_utils_keypairs/src/lib.rs diff --git a/crates/test_utils_solana/Cargo.toml b/crates/test_utils_solana/Cargo.toml index f5b5ebf..5e3fa87 100644 --- a/crates/test_utils_solana/Cargo.toml +++ b/crates/test_utils_solana/Cargo.toml @@ -51,6 +51,7 @@ assert2 = { workspace = true } insta = { workspace = true, features = ["redactions", "json"] } test-log = { workspace = true, features = ["trace"] } test_utils_insta = { workspace = true } +test_utils_keypairs = { workspace = true } tokio = { workspace = true, features = ["test-util", "time"] } [features] diff --git a/crates/test_utils_solana/src/lib.rs b/crates/test_utils_solana/src/lib.rs index 8dc5a16..747568a 100644 --- a/crates/test_utils_solana/src/lib.rs +++ b/crates/test_utils_solana/src/lib.rs @@ -1,4 +1,3 @@ -pub use keypairs::*; pub use solana_banks_client::BanksClientExt; pub use solana_banks_interface::BanksTransactionResultWithSimulation; pub use solana_program_runtime; @@ -16,7 +15,6 @@ pub use test_rpc_provider::*; pub use test_validator_runner::*; pub use utils::*; -mod keypairs; mod macros; mod test_rpc_provider; #[cfg(feature = "test_validator")] diff --git a/crates/test_utils_solana/tests/streams.rs b/crates/test_utils_solana/tests/streams.rs index 077cab2..a103dc8 100644 --- a/crates/test_utils_solana/tests/streams.rs +++ b/crates/test_utils_solana/tests/streams.rs @@ -7,7 +7,7 @@ use std::time::Duration; use assert2::check; use solana_sdk::signature::Keypair; -use test_utils_solana::get_wallet_keypair; +use test_utils_keypairs::get_wallet_keypair; use test_utils_solana::prelude::*; use test_utils_solana::TestValidatorRunner; use test_utils_solana::TestValidatorRunnerProps; diff --git a/crates/wasm_client_solana/Cargo.toml b/crates/wasm_client_solana/Cargo.toml index 63b8fa4..393f7b1 100644 --- a/crates/wasm_client_solana/Cargo.toml +++ b/crates/wasm_client_solana/Cargo.toml @@ -73,7 +73,7 @@ insta = { workspace = true, features = ["redactions", "json"] } spl-pod = { workspace = true } test-log = { workspace = true, features = ["trace"] } test_utils_insta = { workspace = true } -test_utils_solana = { workspace = true } +test_utils_keypairs = { workspace = true } tokio = { workspace = true, features = ["test-util"] } wasm-bindgen-test = { workspace = true } diff --git a/crates/wasm_client_solana/tests/rpc_client.rs b/crates/wasm_client_solana/tests/rpc_client.rs index 311fa94..bf293ae 100644 --- a/crates/wasm_client_solana/tests/rpc_client.rs +++ b/crates/wasm_client_solana/tests/rpc_client.rs @@ -7,7 +7,7 @@ use assert2::check; use futures_timer::Delay; use solana_sdk::native_token::sol_to_lamports; use solana_sdk::signature::Keypair; -use test_utils_solana::get_wallet_keypair; +use test_utils_keypairs::get_wallet_keypair; use wasm_bindgen_test::*; use wasm_client_solana::prelude::*; use wasm_client_solana::rpc_config::LogsSubscribeRequest; diff --git a/programs/example_client/Cargo.toml b/programs/example_client/Cargo.toml index 1ac1789..724234b 100644 --- a/programs/example_client/Cargo.toml +++ b/programs/example_client/Cargo.toml @@ -29,6 +29,7 @@ memory_wallet = { workspace = true } test-log = { workspace = true, features = ["log", "trace"] } test_utils_anchor = { workspace = true, features = ["test_validator"] } test_utils_insta = { workspace = true } +test_utils_keypairs = { workspace = true } test_utils_solana = { workspace = true, features = ["test_validator"] } tokio = { workspace = true, features = ["test-util", "rt", "macros", "time"] } diff --git a/programs/example_client/tests/client.rs b/programs/example_client/tests/client.rs index 42a3786..8b0522e 100644 --- a/programs/example_client/tests/client.rs +++ b/programs/example_client/tests/client.rs @@ -10,7 +10,7 @@ use solana_sdk::signature::Keypair; use solana_sdk::signature::Signature; use test_utils_anchor::anchor_processor; use test_utils_anchor::prelude::*; -use test_utils_solana::get_wallet_keypair; +use test_utils_keypairs::get_wallet_keypair; use test_utils_solana::ProgramTest; use test_utils_solana::TestRpcProvider; diff --git a/readme.md b/readme.md index d77035f..3dd0f7e 100644 --- a/readme.md +++ b/readme.md @@ -20,15 +20,24 @@ This repository contains several crates that make it easier to interact with Solana in WebAssembly environments: -| Crate | Version | Description | -| -------------------- | ------- | ------------------------------------------------------- | -| `test_utils_solana` | 0.5.5 | Testing utilities for Solana programs | -| `test_utils_anchor` | 0.5.5 | Testing utilities specific to Anchor programs | -| `wasm_client_anchor` | 0.7.0 | WebAssembly client for interacting with Anchor programs | -| `wasm_client_solana` | 0.7.0 | WebAssembly client for interacting with Solana programs | +| Crate | Version | Description | +| --------------------- | ------- | ------------------------------------------------------------------------- | +| `memory_wallet` | 0.1.16 | A memory based wallet standard implementation primarily used for testing. | +| `test_utils_insta` | 0.1 | Test utilities for working with `insta` redactions | +| `test_utils_keypairs` | 0.1 | Test utilities for working with pre defined keypairs | +| `test_utils_solana` | 0.5 | Testing utilities for Solana programs | +| `test_utils_anchor` | 0.5 | Testing utilities specific to Anchor programs | +| `wasm_client_anchor` | 0.7.0 | WebAssembly client for interacting with Anchor programs | +| `wasm_client_solana` | 0.7.0 | WebAssembly client for interacting with Solana programs | ### Crate Details +- **memory_wallet**: A memory based wallet standard implementation primarily used for testing. + +- **test_utils_insta**: Test utilities for working with `insta` redactions. + +- **test_utils_keypairs**: Test utilities for working with pre defined keypairs. + - **test_utils_solana**: A collection of utilities to make testing Solana programs easier. Includes helpers for setting up test validators, creating test accounts, and managing test transactions. - **test_utils_anchor**: Extension of test utilities specifically designed for testing Anchor programs. Provides additional helpers for working with Anchor IDLs and program testing.