v0.1.0-pre.007
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
// file: kb-program-ids/src/constants.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Canonical Solana program and well-known account identifiers.
|
||||
|
||||
/// SPL Associated Token Account program identifier.
|
||||
pub const ASSOCIATED_TOKEN_PROGRAM_ID: &str = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
||||
/// Address Lookup Table program identifier.
|
||||
pub const ADDRESS_LOOKUP_TABLE_PROGRAM_ID: &str = "AddressLookupTab1e1111111111111111111111111";
|
||||
/// Deprecated BPF Loader program identifier.
|
||||
@@ -39,6 +41,8 @@ pub const SPL_MEMO_V3_PROGRAM_ID: &str = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLG
|
||||
pub const SPL_MEMO_V4_PROGRAM_ID: &str = "Memo4c2pN8afCj432Lb7RMVKi9PbQnnW7ewFFaV3oAH";
|
||||
/// Classic SPL Token program identifier.
|
||||
pub const SPL_TOKEN_PROGRAM_ID: &str = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
||||
/// SPL Token-2022 program identifier.
|
||||
pub const SPL_TOKEN_2022_PROGRAM_ID: &str = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
||||
/// Historical Stake configuration account identifier.
|
||||
pub const STAKE_CONFIG_ACCOUNT_ID: &str = "StakeConfig11111111111111111111111111111111";
|
||||
/// Compatibility alias for the historical Stake configuration account identifier.
|
||||
@@ -151,6 +155,10 @@ pub(crate) const NATIVE_WELL_KNOWN_ACCOUNT_ID_ENTRIES: &[crate::ProgramIdEntry]
|
||||
];
|
||||
|
||||
pub(crate) const PROGRAM_ID_ENTRIES: &[crate::ProgramIdEntry] = &[
|
||||
crate::ProgramIdEntry {
|
||||
name: "associated_token_account",
|
||||
address: crate::ASSOCIATED_TOKEN_PROGRAM_ID,
|
||||
},
|
||||
crate::ProgramIdEntry {
|
||||
name: "address_lookup_table",
|
||||
address: crate::ADDRESS_LOOKUP_TABLE_PROGRAM_ID,
|
||||
@@ -223,6 +231,10 @@ pub(crate) const PROGRAM_ID_ENTRIES: &[crate::ProgramIdEntry] = &[
|
||||
name: "spl_token",
|
||||
address: crate::SPL_TOKEN_PROGRAM_ID,
|
||||
},
|
||||
crate::ProgramIdEntry {
|
||||
name: "spl_token_2022",
|
||||
address: crate::SPL_TOKEN_2022_PROGRAM_ID,
|
||||
},
|
||||
crate::ProgramIdEntry {
|
||||
name: "stake_config",
|
||||
address: crate::STAKE_CONFIG_ACCOUNT_ID,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: kb-program-ids/src/lib.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![deny(unreachable_pub)]
|
||||
@@ -11,6 +11,8 @@ mod constants;
|
||||
|
||||
/// Address Lookup Table program identifier.
|
||||
pub use constants::ADDRESS_LOOKUP_TABLE_PROGRAM_ID;
|
||||
/// SPL Associated Token Account program identifier.
|
||||
pub use constants::ASSOCIATED_TOKEN_PROGRAM_ID;
|
||||
/// Deprecated BPF Loader program identifier.
|
||||
pub use constants::BPF_LOADER_DEPRECATED_PROGRAM_ID;
|
||||
/// BPF Loader version 2 program identifier.
|
||||
@@ -49,6 +51,8 @@ pub use constants::SPL_MEMO_V1_PROGRAM_ID;
|
||||
pub use constants::SPL_MEMO_V3_PROGRAM_ID;
|
||||
/// Current SPL Memo v4 program identifier.
|
||||
pub use constants::SPL_MEMO_V4_PROGRAM_ID;
|
||||
/// SPL Token-2022 program identifier.
|
||||
pub use constants::SPL_TOKEN_2022_PROGRAM_ID;
|
||||
/// Classic SPL Token program identifier.
|
||||
pub use constants::SPL_TOKEN_PROGRAM_ID;
|
||||
/// Historical Stake configuration account identifier.
|
||||
@@ -138,7 +142,7 @@ mod tests {
|
||||
assert!(codes.insert(entry.code()));
|
||||
assert!(program_ids.insert(entry.program_id()));
|
||||
}
|
||||
assert_eq!(crate::registered_program_ids().len(), 29);
|
||||
assert_eq!(crate::registered_program_ids().len(), 31);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -201,6 +205,8 @@ mod tests {
|
||||
crate::SPL_MEMO_V3_PROGRAM_ID,
|
||||
crate::SPL_MEMO_V4_PROGRAM_ID,
|
||||
crate::SPL_TOKEN_PROGRAM_ID,
|
||||
crate::SPL_TOKEN_2022_PROGRAM_ID,
|
||||
crate::ASSOCIATED_TOKEN_PROGRAM_ID,
|
||||
];
|
||||
for program_id in spl_program_ids {
|
||||
assert!(crate::find_registered_program_id(program_id).is_some());
|
||||
|
||||
Reference in New Issue
Block a user