mod auction_manager; pub use auction_manager::*; use solana_program::pubkey::Pubkey; use solana_program_test::ProgramTestContext; use solana_sdk::account::Account; pub async fn get_account(context: &mut ProgramTestContext, pubkey: &Pubkey) -> Account { context .banks_client .get_account(*pubkey) .await .expect("account not found") .expect("account empty") } #[macro_export] macro_rules! assert_custom_instruction_error { ($ix:expr, $error:expr, $matcher:pat) => { match $error { solana_program_test::BanksClientError::TransactionError( solana_sdk::transaction::TransactionError::InstructionError( $ix, solana_sdk::instruction::InstructionError::Custom(x), ), ) => match num_traits::FromPrimitive::from_i32(x as i32) { Some($matcher) => assert!(true), Some(other) => { assert!( false, "Expected another custom instruction error than '{:#?}'", other ) } None => assert!(false, "Expected custom instruction error"), }, err => assert!( false, "Expected custom instruction error but got '{:#?}'", err ), }; }; }