From 0b19841d9191b97b91dc9ce23fd09270eecdfb29 Mon Sep 17 00:00:00 2001 From: kevinheavey Date: Thu, 7 Nov 2024 16:13:42 +0400 Subject: [PATCH] import program id from solana_sdk_ids --- Cargo.lock | 2 +- programs/sbf/Cargo.lock | 2 +- sdk/secp256k1-instruction/Cargo.toml | 8 +++++--- sdk/secp256k1-instruction/src/lib.rs | 12 +----------- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39a71e145e57cb..b530a46f3fdbe3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8429,8 +8429,8 @@ dependencies = [ "solana-logger", "solana-precompile-error", "solana-program", - "solana-pubkey", "solana-sdk", + "solana-sdk-ids", "solana-secp256k1-instruction", ] diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 3416987c3e2c52..f691d17d4d4912 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -7143,7 +7143,7 @@ dependencies = [ "solana-feature-set", "solana-instruction", "solana-precompile-error", - "solana-pubkey", + "solana-sdk-ids", ] [[package]] diff --git a/sdk/secp256k1-instruction/Cargo.toml b/sdk/secp256k1-instruction/Cargo.toml index 0f240caffeba3a..70c9378789e58f 100644 --- a/sdk/secp256k1-instruction/Cargo.toml +++ b/sdk/secp256k1-instruction/Cargo.toml @@ -19,7 +19,7 @@ sha3 = { workspace = true } solana-feature-set = { workspace = true } solana-instruction = { workspace = true, features = ["std"] } solana-precompile-error = { workspace = true } -solana-pubkey = { workspace = true, optional = true } +solana-sdk-ids = { workspace = true, optional = true } [dev-dependencies] anyhow = { workspace = true } @@ -29,10 +29,12 @@ solana-hash = { workspace = true } solana-logger = { workspace = true } solana-program = { path = "../program" } solana-sdk = { path = ".." } -solana-secp256k1-instruction = { path = ".", features = ["dev-context-only-utils"] } +solana-secp256k1-instruction = { path = ".", features = [ + "dev-context-only-utils", +] } [features] -bincode = ["dep:bincode", "dep:solana-pubkey", "serde"] +bincode = ["dep:bincode", "dep:solana-sdk-ids", "serde"] dev-context-only-utils = ["bincode"] serde = ["dep:serde", "dep:serde_derive"] diff --git a/sdk/secp256k1-instruction/src/lib.rs b/sdk/secp256k1-instruction/src/lib.rs index 46d53070870525..0a4b7f26b065cf 100644 --- a/sdk/secp256k1-instruction/src/lib.rs +++ b/sdk/secp256k1-instruction/src/lib.rs @@ -797,11 +797,6 @@ pub const SIGNATURE_SERIALIZED_SIZE: usize = 64; pub const SIGNATURE_OFFSETS_SERIALIZED_SIZE: usize = 11; pub const DATA_START: usize = SIGNATURE_OFFSETS_SERIALIZED_SIZE + 1; -// inline from solana_sdk::secp256k1_program to avoid solana_sdk dependency -#[cfg(feature = "bincode")] -const SECP256K1_PROGRAM_ID: solana_pubkey::Pubkey = - solana_pubkey::pubkey!("KeccakSecp256k11111111111111111111111111111"); - /// Offsets of signature data within a secp256k1 instruction. /// /// See the [module documentation][md] for a complete description. @@ -897,7 +892,7 @@ pub fn new_secp256k1_instruction( bincode::serialize_into(writer, &offsets).unwrap(); Instruction { - program_id: SECP256K1_PROGRAM_ID, + program_id: solana_sdk_ids::secp256k1_program::id(), accounts: vec![], data: instruction_data, } @@ -1310,9 +1305,4 @@ pub mod test { ) .unwrap(); } - - #[test] - fn test_inlined_program_id() { - assert_eq!(SECP256K1_PROGRAM_ID, solana_sdk::secp256k1_program::id()); - } }