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 7, 2024
1 parent 58600b9 commit a606a44
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 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.

2 changes: 1 addition & 1 deletion sdk/ed25519-instructions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ed25519-dalek = { workspace = true }
solana-feature-set = { workspace = true }
solana-instruction = { workspace = true, features = ["std"] }
solana-precompile-error = { workspace = true }
solana-pubkey = { workspace = true }
solana-sdk-ids = { workspace = true }

[dev-dependencies]
hex = { workspace = true }
Expand Down
10 changes: 1 addition & 9 deletions sdk/ed25519-instructions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use {
solana_feature_set::{ed25519_precompile_verify_strict, FeatureSet},
solana_instruction::Instruction,
solana_precompile_error::PrecompileError,
solana_pubkey::{pubkey, Pubkey},
};

pub const PUBKEY_SERIALIZED_SIZE: usize = 32;
Expand All @@ -18,8 +17,6 @@ pub const SIGNATURE_OFFSETS_SERIALIZED_SIZE: usize = 14;
// bytemuck requires structures to be aligned
pub const SIGNATURE_OFFSETS_START: usize = 2;
pub const DATA_START: usize = SIGNATURE_OFFSETS_SERIALIZED_SIZE + SIGNATURE_OFFSETS_START;
// copied from solana_sdk::ed25519_program to avoid solana_sdk dependency
const ED25519_PROGRAM_ID: Pubkey = pubkey!("Ed25519SigVerify111111111111111111111111111");

#[derive(Default, Debug, Copy, Clone, Zeroable, Pod, Eq, PartialEq)]
#[repr(C)]
Expand Down Expand Up @@ -80,7 +77,7 @@ pub fn new_ed25519_instruction(keypair: &ed25519_dalek::Keypair, message: &[u8])
instruction_data.extend_from_slice(message);

Instruction {
program_id: ED25519_PROGRAM_ID,
program_id: solana_sdk_ids::ed25519_program::id(),
accounts: vec![],
data: instruction_data,
}
Expand Down Expand Up @@ -489,9 +486,4 @@ pub mod test {
let feature_set = FeatureSet::all_enabled();
assert!(tx.verify_precompiles(&feature_set).is_err()); // verify_strict does NOT pass
}

#[test]
fn test_inlined_program_id() {
assert_eq!(ED25519_PROGRAM_ID, solana_sdk::ed25519_program::id())
}
}

0 comments on commit a606a44

Please sign in to comment.