diff --git a/programs/budget_api/src/lib.rs b/programs/budget_api/src/lib.rs index b5888f8f96..685ff9bff1 100644 --- a/programs/budget_api/src/lib.rs +++ b/programs/budget_api/src/lib.rs @@ -3,17 +3,9 @@ pub mod budget_instruction; pub mod budget_processor; pub mod budget_state; -use solana_sdk::pubkey::Pubkey; - const BUDGET_PROGRAM_ID: [u8; 32] = [ 2, 203, 81, 223, 225, 24, 34, 35, 203, 214, 138, 130, 144, 208, 35, 77, 63, 16, 87, 51, 47, 198, 115, 123, 98, 188, 19, 160, 0, 0, 0, 0, ]; -pub fn id() -> Pubkey { - Pubkey::new(&BUDGET_PROGRAM_ID) -} - -pub fn check_id(program_id: &Pubkey) -> bool { - program_id.as_ref() == BUDGET_PROGRAM_ID -} +solana_sdk::solana_program_id!(BUDGET_PROGRAM_ID); diff --git a/programs/config_api/src/lib.rs b/programs/config_api/src/lib.rs index a00e760eac..5b48611cd7 100644 --- a/programs/config_api/src/lib.rs +++ b/programs/config_api/src/lib.rs @@ -1,5 +1,4 @@ use serde::Serialize; -use solana_sdk::pubkey::Pubkey; pub mod config_instruction; pub mod config_processor; @@ -9,13 +8,7 @@ const CONFIG_PROGRAM_ID: [u8; 32] = [ 64, 25, 163, 35, 239, 160, 0, 0, 0, 0, ]; -pub fn check_id(program_id: &Pubkey) -> bool { - program_id.as_ref() == CONFIG_PROGRAM_ID -} - -pub fn id() -> Pubkey { - Pubkey::new(&CONFIG_PROGRAM_ID) -} +solana_sdk::solana_program_id!(CONFIG_PROGRAM_ID); pub trait ConfigState: Serialize { /// Maximum space that the serialized representation will require diff --git a/programs/exchange_api/src/lib.rs b/programs/exchange_api/src/lib.rs index 767b717f68..87b3582974 100644 --- a/programs/exchange_api/src/lib.rs +++ b/programs/exchange_api/src/lib.rs @@ -5,17 +5,9 @@ pub mod exchange_state; #[macro_use] extern crate solana_metrics; -use solana_sdk::pubkey::Pubkey; - pub const EXCHANGE_PROGRAM_ID: [u8; 32] = [ 3, 147, 111, 103, 210, 47, 14, 213, 108, 116, 49, 115, 232, 171, 14, 111, 167, 140, 221, 234, 33, 70, 185, 192, 42, 31, 141, 152, 0, 0, 0, 0, ]; -pub fn check_id(program_id: &Pubkey) -> bool { - program_id.as_ref() == EXCHANGE_PROGRAM_ID -} - -pub fn id() -> Pubkey { - Pubkey::new(&EXCHANGE_PROGRAM_ID) -} +solana_sdk::solana_program_id!(EXCHANGE_PROGRAM_ID); diff --git a/programs/stake_api/src/lib.rs b/programs/stake_api/src/lib.rs index 2cb27e4170..c4375c41c1 100644 --- a/programs/stake_api/src/lib.rs +++ b/programs/stake_api/src/lib.rs @@ -1,17 +1,9 @@ pub mod stake_instruction; pub mod stake_state; -use solana_sdk::pubkey::Pubkey; - const STAKE_PROGRAM_ID: [u8; 32] = [ 6, 161, 216, 23, 145, 55, 84, 42, 152, 52, 55, 189, 254, 42, 122, 178, 85, 127, 83, 92, 138, 120, 114, 43, 104, 164, 157, 192, 0, 0, 0, 0, ]; -pub fn check_id(program_id: &Pubkey) -> bool { - program_id.as_ref() == STAKE_PROGRAM_ID -} - -pub fn id() -> Pubkey { - Pubkey::new(&STAKE_PROGRAM_ID) -} +solana_sdk::solana_program_id!(STAKE_PROGRAM_ID); diff --git a/programs/storage_api/src/lib.rs b/programs/storage_api/src/lib.rs index 4f292e28a6..514ddfcd37 100644 --- a/programs/storage_api/src/lib.rs +++ b/programs/storage_api/src/lib.rs @@ -2,8 +2,6 @@ pub mod storage_contract; pub mod storage_instruction; pub mod storage_processor; -use solana_sdk::pubkey::Pubkey; - pub const SLOTS_PER_SEGMENT: u64 = 2; pub fn get_segment_from_slot(slot: u64) -> usize { @@ -14,11 +12,4 @@ const STORAGE_PROGRAM_ID: [u8; 32] = [ 6, 162, 25, 123, 127, 68, 233, 59, 131, 151, 21, 152, 162, 120, 90, 37, 154, 88, 86, 5, 156, 221, 182, 201, 142, 103, 151, 112, 0, 0, 0, 0, ]; - -pub fn check_id(program_id: &Pubkey) -> bool { - program_id.as_ref() == STORAGE_PROGRAM_ID -} - -pub fn id() -> Pubkey { - Pubkey::new(&STORAGE_PROGRAM_ID) -} +solana_sdk::solana_program_id!(STORAGE_PROGRAM_ID);