Instruction symbol and error printing in prod builds

Change-Id: I3315c49272473ef3216f26b9dd21f5cfcce6e8ae
This commit is contained in:
Reisen 2021-08-09 12:33:11 +00:00
parent add04e8755
commit 2f8a73fdda
1 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ macro_rules! solitaire {
$(
n if n == Instruction::$row as u8 => {
(move || {
trace!("Dispatch: {}", stringify!($row));
solana_program::msg!("Dispatch: {}", stringify!($row));
let ix_data: $kind = BorshDeserialize::try_from_slice(&d[1..]).map_err(|e| SolitaireError::InstructionDeserializeFailed(e))?;
let mut accounts: $row = FromAccounts::from(p, &mut a.iter(), &())?;
$fn(&ExecutionContext{program_id: p, accounts: a}, &mut accounts, ix_data)?;
@ -89,7 +89,7 @@ macro_rules! solitaire {
pub fn solitaire<'a, 'b: 'a>(p: &Pubkey, a: &'a [AccountInfo<'b>], d: &[u8]) -> ProgramResult {
trace!("{} {} built with {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"), solitaire::PKG_NAME_VERSION);
if let Err(err) = dispatch(p, a, d) {
trace!("Error: {:?}", err);
solana_program::msg!("Error: {:?}", err);
return Err(err.into());
}
Ok(())