0.1.0-pre.005
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: kb-program-ids/src/constants.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Canonical Solana program and well-known account identifiers.
|
||||
|
||||
@@ -31,6 +31,12 @@ pub const SECP256K1_PROGRAM_ID: &str = "KeccakSecp256k11111111111111111111111111
|
||||
pub const SECP256R1_PROGRAM_ID: &str = "Secp256r1SigVerify1111111111111111111111111";
|
||||
/// Enshrined stateless Slashing program identifier.
|
||||
pub const SLASHING_PROGRAM_ID: &str = "S1ashing11111111111111111111111111111111111";
|
||||
/// Historical SPL Memo v1 program identifier.
|
||||
pub const SPL_MEMO_V1_PROGRAM_ID: &str = "Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo";
|
||||
/// Historical SPL Memo v3 program identifier.
|
||||
pub const SPL_MEMO_V3_PROGRAM_ID: &str = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
|
||||
/// Current SPL Memo v4 program identifier.
|
||||
pub const SPL_MEMO_V4_PROGRAM_ID: &str = "Memo4c2pN8afCj432Lb7RMVKi9PbQnnW7ewFFaV3oAH";
|
||||
/// Classic SPL Token program identifier.
|
||||
pub const SPL_TOKEN_PROGRAM_ID: &str = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
||||
/// Historical Stake configuration account identifier.
|
||||
@@ -201,6 +207,18 @@ pub(crate) const PROGRAM_ID_ENTRIES: &[crate::ProgramIdEntry] = &[
|
||||
name: "slashing",
|
||||
address: crate::SLASHING_PROGRAM_ID,
|
||||
},
|
||||
crate::ProgramIdEntry {
|
||||
name: "spl_memo_v1",
|
||||
address: crate::SPL_MEMO_V1_PROGRAM_ID,
|
||||
},
|
||||
crate::ProgramIdEntry {
|
||||
name: "spl_memo_v3",
|
||||
address: crate::SPL_MEMO_V3_PROGRAM_ID,
|
||||
},
|
||||
crate::ProgramIdEntry {
|
||||
name: "spl_memo_v4",
|
||||
address: crate::SPL_MEMO_V4_PROGRAM_ID,
|
||||
},
|
||||
crate::ProgramIdEntry {
|
||||
name: "spl_token",
|
||||
address: crate::SPL_TOKEN_PROGRAM_ID,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: kb-program-ids/src/lib.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![deny(unreachable_pub)]
|
||||
@@ -43,6 +43,12 @@ pub use constants::SECP256K1_PROGRAM_ID;
|
||||
pub use constants::SECP256R1_PROGRAM_ID;
|
||||
/// Enshrined stateless Slashing program identifier.
|
||||
pub use constants::SLASHING_PROGRAM_ID;
|
||||
/// Historical SPL Memo v1 program identifier.
|
||||
pub use constants::SPL_MEMO_V1_PROGRAM_ID;
|
||||
/// Historical SPL Memo v3 program identifier.
|
||||
pub use constants::SPL_MEMO_V3_PROGRAM_ID;
|
||||
/// Current SPL Memo v4 program identifier.
|
||||
pub use constants::SPL_MEMO_V4_PROGRAM_ID;
|
||||
/// Classic SPL Token program identifier.
|
||||
pub use constants::SPL_TOKEN_PROGRAM_ID;
|
||||
/// Historical Stake configuration account identifier.
|
||||
@@ -132,7 +138,7 @@ mod tests {
|
||||
assert!(codes.insert(entry.code()));
|
||||
assert!(program_ids.insert(entry.program_id()));
|
||||
}
|
||||
assert_eq!(crate::registered_program_ids().len(), 26);
|
||||
assert_eq!(crate::registered_program_ids().len(), 29);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -187,4 +193,21 @@ mod tests {
|
||||
assert!(crate::find_registered_program_id(program_id).is_some());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn spl_memo_generations_are_registered_without_joining_native_surfaces() {
|
||||
let memo_program_ids = [
|
||||
crate::SPL_MEMO_V1_PROGRAM_ID,
|
||||
crate::SPL_MEMO_V3_PROGRAM_ID,
|
||||
crate::SPL_MEMO_V4_PROGRAM_ID,
|
||||
];
|
||||
for program_id in memo_program_ids {
|
||||
assert!(crate::find_registered_program_id(program_id).is_some());
|
||||
assert!(
|
||||
!crate::native_program_ids()
|
||||
.iter()
|
||||
.any(|entry| return entry.program_id() == program_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user