lang: Include `pubkey!` macro in `prelude` (#3026)
This commit is contained in:
parent
81c2519a9b
commit
1c2aabe315
|
@ -400,7 +400,7 @@ pub mod prelude {
|
|||
accounts::signer::Signer, accounts::system_account::SystemAccount,
|
||||
accounts::sysvar::Sysvar, accounts::unchecked_account::UncheckedAccount, constant,
|
||||
context::Context, context::CpiContext, declare_id, declare_program, emit, err, error,
|
||||
event, program, require, require_eq, require_gt, require_gte, require_keys_eq,
|
||||
event, program, pubkey, require, require_eq, require_gt, require_gte, require_keys_eq,
|
||||
require_keys_neq, require_neq,
|
||||
solana_program::bpf_loader_upgradeable::UpgradeableLoaderState, source,
|
||||
system_program::System, zero_copy, AccountDeserialize, AccountSerialize, Accounts,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use anchor_lang::prelude::*;
|
||||
use anchor_spl::{token, token_interface};
|
||||
use std::str::FromStr;
|
||||
|
||||
declare_id!("id11111111111111111111111111111111111111111");
|
||||
|
||||
|
@ -221,7 +220,7 @@ impl Default for State {
|
|||
i128_field: i128::MIN / 2 - 10,
|
||||
bytes_field: vec![1, 2, 255, 254],
|
||||
string_field: String::from("hello"),
|
||||
pubkey_field: Pubkey::from_str("EPZP2wrcRtMxrAPJCXVEQaYD9eH7fH7h12YqKDcd4aS7").unwrap(),
|
||||
pubkey_field: pubkey!("EPZP2wrcRtMxrAPJCXVEQaYD9eH7fH7h12YqKDcd4aS7"),
|
||||
vec_field: vec![1, 2, 100, 1000, u64::MAX],
|
||||
vec_struct_field: vec![FooStruct::default()],
|
||||
option_field: None,
|
||||
|
|
Loading…
Reference in New Issue