diff --git a/Cargo.lock b/Cargo.lock index cbf4f29912..ff5e8ca6f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -227,6 +227,7 @@ dependencies = [ "shellexpand", "solana-cli-config", "solana-faucet", + "solana-pubkey 2.2.1", "solana-rpc-client", "solana-sdk", "syn 1.0.109", @@ -246,6 +247,7 @@ dependencies = [ "serde", "solana-account", "solana-account-decoder", + "solana-pubkey 2.2.1", "solana-pubsub-client", "solana-rpc-client", "solana-rpc-client-api", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index a1448a115c..83b610f463 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -40,6 +40,7 @@ solana-cli-config = "2" solana-faucet = "2" solana-rpc-client = "2" solana-sdk = "2" +solana-pubkey = "2" syn = { version = "1.0.60", features = ["full", "extra-traits"] } tar = "0.4.35" toml = "0.7.6" diff --git a/cli/src/config.rs b/cli/src/config.rs index e9b2e760c2..4fd9e38f0c 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -10,8 +10,8 @@ use serde::de::{self, MapAccess, Visitor}; use serde::ser::SerializeMap; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use solana_cli_config::{Config as SolanaConfig, CONFIG_FILE}; +use solana_pubkey::Pubkey; use solana_sdk::clock::Slot; -use solana_sdk::pubkey::Pubkey; use solana_sdk::signature::{Keypair, Signer}; use std::collections::{BTreeMap, HashMap}; use std::convert::TryFrom; diff --git a/cli/src/lib.rs b/cli/src/lib.rs index b8ad661b77..e70d377924 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -22,11 +22,11 @@ use regex::{Regex, RegexBuilder}; use rust_template::{ProgramTemplate, TestTemplate}; use semver::{Version, VersionReq}; use serde_json::{json, Map, Value as JsonValue}; +use solana_pubkey::Pubkey; use solana_rpc_client::rpc_client::RpcClient; use solana_sdk::commitment_config::CommitmentConfig; use solana_sdk::compute_budget::ComputeBudgetInstruction; use solana_sdk::instruction::{AccountMeta, Instruction}; -use solana_sdk::pubkey::Pubkey; use solana_sdk::signature::Keypair; use solana_sdk::signature::Signer; use solana_sdk::signer::EncodableKey; diff --git a/cli/src/rust_template.rs b/cli/src/rust_template.rs index 18a9c35709..c64da16d50 100644 --- a/cli/src/rust_template.rs +++ b/cli/src/rust_template.rs @@ -5,8 +5,8 @@ use crate::{ use anyhow::Result; use clap::{Parser, ValueEnum}; use heck::{ToLowerCamelCase, ToPascalCase, ToSnakeCase}; +use solana_pubkey::Pubkey; use solana_sdk::{ - pubkey::Pubkey, signature::{read_keypair_file, write_keypair_file, Keypair}, signer::Signer, }; @@ -779,8 +779,9 @@ mod test_initialize; r#"use std::str::FromStr; use anchor_client::{{ + solana_pubkey::Pubkey, solana_sdk::{{ - commitment_config::CommitmentConfig, pubkey::Pubkey, signature::read_keypair_file, + commitment_config::CommitmentConfig, signature::read_keypair_file, }}, Client, Cluster, }}; diff --git a/client/Cargo.toml b/client/Cargo.toml index ac2044e935..32f90227ab 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -27,6 +27,7 @@ solana-rpc-client = "2" solana-rpc-client-api = "2" solana-account = "2" solana-sdk = "2" +solana-pubkey = "2" thiserror = "1" tokio = { version = "1", features = ["rt", "sync"] } url = "2" diff --git a/client/example/src/blocking.rs b/client/example/src/blocking.rs index eaf7a01b28..0f0444e8e4 100644 --- a/client/example/src/blocking.rs +++ b/client/example/src/blocking.rs @@ -1,4 +1,4 @@ -use anchor_client::solana_sdk::pubkey::Pubkey; +use anchor_client::solana_pubkey::Pubkey; use anchor_client::solana_sdk::signature::{Keypair, Signer}; use anchor_client::solana_sdk::system_instruction; use anchor_client::{Client, Cluster}; diff --git a/client/example/src/main.rs b/client/example/src/main.rs index f13e76c7d1..53d96f20e0 100644 --- a/client/example/src/main.rs +++ b/client/example/src/main.rs @@ -1,4 +1,4 @@ -use anchor_client::solana_sdk::pubkey::Pubkey; +use anchor_client::solana_pubkey::Pubkey; use anyhow::Result; use clap::Parser; diff --git a/client/example/src/nonblocking.rs b/client/example/src/nonblocking.rs index 4c7b0fd66b..88b16561d5 100644 --- a/client/example/src/nonblocking.rs +++ b/client/example/src/nonblocking.rs @@ -1,4 +1,4 @@ -use anchor_client::solana_sdk::pubkey::Pubkey; +use anchor_client::solana_pubkey::Pubkey; use anchor_client::solana_sdk::signature::{Keypair, Signer}; use anchor_client::solana_sdk::system_instruction; use anchor_client::{Client, Cluster}; diff --git a/client/src/lib.rs b/client/src/lib.rs index 652f96cafa..10eb9098dc 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -113,6 +113,7 @@ pub use cluster::Cluster; #[cfg(feature = "async")] pub use nonblocking::ThreadSafeSigner; pub use solana_account_decoder; +pub use solana_pubkey; pub use solana_sdk; mod cluster; diff --git a/docs/content/docs/quickstart/local.mdx b/docs/content/docs/quickstart/local.mdx index 004dd71476..c6427eade7 100644 --- a/docs/content/docs/quickstart/local.mdx +++ b/docs/content/docs/quickstart/local.mdx @@ -182,8 +182,9 @@ The Rust test file will be at `/tests/src/test_initialize.rs`. use std::str::FromStr; use anchor_client::{ + solana_pubkey::Pubkey, solana_sdk::{ - commitment_config::CommitmentConfig, pubkey::Pubkey, signature::read_keypair_file, + commitment_config::CommitmentConfig, signature::read_keypair_file, }, Client, Cluster, }; diff --git a/docs/content/docs/testing/mollusk.mdx b/docs/content/docs/testing/mollusk.mdx index db7c9fd097..744c0a6b34 100644 --- a/docs/content/docs/testing/mollusk.mdx +++ b/docs/content/docs/testing/mollusk.mdx @@ -52,8 +52,8 @@ checks on the result. In both cases, the result is also returned. ```rust use { mollusk_svm::Mollusk, - solana_account::Account, - solana_sdk::{instruction::{AccountMeta, Instruction}, pubkey::Pubkey}, + solana_pubkey::Pubkey, + solana_sdk::{account::Account, instruction::{AccountMeta, Instruction}}, }; let program_id = Pubkey::new_unique(); @@ -86,10 +86,9 @@ To apply checks via `process_and_validate_instruction`, developers can use the ```rust use { mollusk_svm::{Mollusk, result::Check}, - solana_account::Account, + solana_pubkey::Pubkey, solana_sdk::{ instruction::{AccountMeta, Instruction}, - pubkey::Pubkey system_instruction, system_program, }, @@ -146,8 +145,8 @@ the final result is also returned. ```rust use { mollusk_svm::Mollusk, - solana_account::Account, - solana_sdk::{pubkey::Pubkey, system_instruction}, + solana_pubkey::Pubkey, + solana_sdk::{account::Account, system_instruction}, }; let mollusk = Mollusk::default(); @@ -188,8 +187,8 @@ returned by the method is the final result of the last instruction in the chain. ```rust use { mollusk_svm::{Mollusk, result::Check}, - solana_account::Account, - solana_sdk::{pubkey::Pubkey, system_instruction}, + solana_pubkey::Pubkey, + solana_sdk::{account::Account, system_instruction}, }; let mollusk = Mollusk::default(); diff --git a/tests/zero-copy/programs/zero-copy/tests/compute_unit_test.rs b/tests/zero-copy/programs/zero-copy/tests/compute_unit_test.rs index 593620ca46..0e4ba317be 100644 --- a/tests/zero-copy/programs/zero-copy/tests/compute_unit_test.rs +++ b/tests/zero-copy/programs/zero-copy/tests/compute_unit_test.rs @@ -3,10 +3,9 @@ use { anchor_client::{ anchor_lang::Discriminator, - solana_account::Account, + solana_pubkey::Pubkey, solana_sdk::{ commitment_config::CommitmentConfig, - pubkey::Pubkey, signature::{Keypair, Signer}, transaction::Transaction, },