use mpl_distro::ID;
use solana_program_test::ProgramTest;
pub fn program_test() -> ProgramTest {
ProgramTest::new("mpl_distro_program", ID, None)
}
#[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
),
};
};
}