Skip to content

Commit

Permalink
lang: Include pubkey! macro in prelude (#3026)
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto authored Jun 15, 2024
1 parent 81c2519 commit 1c2aabe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lang/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions tests/idl/programs/idl/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use anchor_lang::prelude::*;
use anchor_spl::{token, token_interface};
use std::str::FromStr;

declare_id!("id11111111111111111111111111111111111111111");

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1c2aabe

Please sign in to comment.