Skip to content

Commit

Permalink
import program id from solana_sdk_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Nov 14, 2024
1 parent 7196c4d commit 0b19841
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions sdk/secp256k1-instruction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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"]

Expand Down
12 changes: 1 addition & 11 deletions sdk/secp256k1-instruction/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -1310,9 +1305,4 @@ pub mod test {
)
.unwrap();
}

#[test]
fn test_inlined_program_id() {
assert_eq!(SECP256K1_PROGRAM_ID, solana_sdk::secp256k1_program::id());
}
}

0 comments on commit 0b19841

Please sign in to comment.