From d9c24ed5837407aa411fbb7cc881c4a1a9757f5e Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Fri, 1 Nov 2024 03:11:57 +0400 Subject: [PATCH] remove solana-program from zk-token-sdk (#3410) --- Cargo.lock | 3 ++- programs/sbf/Cargo.lock | 3 ++- zk-token-sdk/Cargo.toml | 3 ++- zk-token-sdk/src/zk_token_elgamal/pod/mod.rs | 2 +- zk-token-sdk/src/zk_token_proof_instruction.rs | 6 ++---- zk-token-sdk/src/zk_token_proof_program.rs | 2 +- zk-token-sdk/src/zk_token_proof_state.rs | 6 ++---- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a5ad2537269fc3..bec8dee1a49c43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9073,7 +9073,8 @@ dependencies = [ "sha3", "solana-curve25519", "solana-derivation-path", - "solana-program", + "solana-instruction", + "solana-pubkey", "solana-sdk", "subtle", "thiserror", diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 821045dbe25e73..98dd73792c191a 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -7510,7 +7510,8 @@ dependencies = [ "sha3", "solana-curve25519", "solana-derivation-path", - "solana-program", + "solana-instruction", + "solana-pubkey", "solana-sdk", "subtle", "thiserror", diff --git a/zk-token-sdk/Cargo.toml b/zk-token-sdk/Cargo.toml index a47164889ea133..f5e431f54c94ae 100644 --- a/zk-token-sdk/Cargo.toml +++ b/zk-token-sdk/Cargo.toml @@ -16,7 +16,8 @@ bytemuck_derive = { workspace = true } num-derive = { workspace = true } num-traits = { workspace = true } solana-curve25519 = { workspace = true } -solana-program = { workspace = true } +solana-instruction = { workspace = true, features = ["std"] } +solana-pubkey = { workspace = true } thiserror = { workspace = true } [dev-dependencies] diff --git a/zk-token-sdk/src/zk_token_elgamal/pod/mod.rs b/zk-token-sdk/src/zk_token_elgamal/pod/mod.rs index d060213a37d6a8..7b670c61b4ec2d 100644 --- a/zk-token-sdk/src/zk_token_elgamal/pod/mod.rs +++ b/zk-token-sdk/src/zk_token_elgamal/pod/mod.rs @@ -9,7 +9,7 @@ mod sigma_proofs; use { crate::zk_token_proof_instruction::ProofType, num_traits::{FromPrimitive, ToPrimitive}, - solana_program::instruction::InstructionError, + solana_instruction::error::InstructionError, thiserror::Error, }; pub use { diff --git a/zk-token-sdk/src/zk_token_proof_instruction.rs b/zk-token-sdk/src/zk_token_proof_instruction.rs index afcf4f36a3e211..e588ea630b7b54 100644 --- a/zk-token-sdk/src/zk_token_proof_instruction.rs +++ b/zk-token-sdk/src/zk_token_proof_instruction.rs @@ -37,10 +37,8 @@ use { bytemuck::bytes_of, num_derive::{FromPrimitive, ToPrimitive}, num_traits::{FromPrimitive, ToPrimitive}, - solana_program::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, - }, + solana_instruction::{AccountMeta, Instruction}, + solana_pubkey::Pubkey, }; #[derive(Clone, Copy, Debug, FromPrimitive, ToPrimitive, PartialEq, Eq)] diff --git a/zk-token-sdk/src/zk_token_proof_program.rs b/zk-token-sdk/src/zk_token_proof_program.rs index 9a525702b8543f..6b8e5cfa39026a 100644 --- a/zk-token-sdk/src/zk_token_proof_program.rs +++ b/zk-token-sdk/src/zk_token_proof_program.rs @@ -8,4 +8,4 @@ //! [`ZK Token proof`]: https://docs.solanalabs.com/runtime/zk-token-proof // Program Id of the ZkToken Proof program -solana_program::declare_id!("ZkTokenProof1111111111111111111111111111111"); +solana_pubkey::declare_id!("ZkTokenProof1111111111111111111111111111111"); diff --git a/zk-token-sdk/src/zk_token_proof_state.rs b/zk-token-sdk/src/zk_token_proof_state.rs index 6d9644394ce197..2c5afcdc28e58a 100644 --- a/zk-token-sdk/src/zk_token_proof_state.rs +++ b/zk-token-sdk/src/zk_token_proof_state.rs @@ -2,10 +2,8 @@ use { crate::{zk_token_elgamal::pod::PodProofType, zk_token_proof_instruction::ProofType}, bytemuck::{bytes_of, Pod, Zeroable}, num_traits::ToPrimitive, - solana_program::{ - instruction::{InstructionError, InstructionError::InvalidAccountData}, - pubkey::Pubkey, - }, + solana_instruction::error::{InstructionError, InstructionError::InvalidAccountData}, + solana_pubkey::Pubkey, std::mem::size_of, };