add new macro: pubkey! (backport #21245) (#21288)

This commit is contained in:
mergify[bot]
2021-11-15 13:42:30 -08:00
committed by GitHub
parent a05c08e711
commit 1a0eabe340
3 changed files with 74 additions and 0 deletions

View File

@@ -73,6 +73,22 @@ pub mod transport;
/// assert_eq!(id(), my_id);
/// ```
pub use solana_sdk_macro::declare_id;
/// Convenience macro to define a static public key
///
/// Input: a single literal base58 string representation of a Pubkey
///
/// # Example
///
/// ```
/// use std::str::FromStr;
/// use solana_program::{pubkey, pubkey::Pubkey};
///
/// static ID: Pubkey = pubkey!("My11111111111111111111111111111111111111111");
///
/// let my_id = Pubkey::from_str("My11111111111111111111111111111111111111111").unwrap();
/// assert_eq!(ID, my_id);
/// ```
pub use solana_sdk_macro::pubkey;
pub use solana_sdk_macro::pubkeys;
#[rustversion::since(1.46.0)]
pub use solana_sdk_macro::respan;