|
@@ -46,6 +46,9 @@ fn id_to_tokens(
|
|
|
/// The static program ID
|
|
|
pub static ID: #pubkey_type = #id;
|
|
|
|
|
|
+ /// Const version of `ID`
|
|
|
+ pub const ID_CONST: #pubkey_type = #id;
|
|
|
+
|
|
|
/// Confirms that a given pubkey is equivalent to the program ID
|
|
|
pub fn check_id(id: &#pubkey_type) -> bool {
|
|
|
id == &ID
|
|
@@ -56,6 +59,11 @@ fn id_to_tokens(
|
|
|
ID
|
|
|
}
|
|
|
|
|
|
+ /// Const version of `ID`
|
|
|
+ pub const fn id_const() -> #pubkey_type {
|
|
|
+ ID_CONST
|
|
|
+ }
|
|
|
+
|
|
|
#[cfg(test)]
|
|
|
#[test]
|
|
|
fn test_id() {
|