Add ProgramError::CustomError and truncate value to 32 bytes

This commit is contained in:
Tyera Eulberg
2019-03-11 13:40:52 -06:00
committed by Greg Fitzgerald
parent 56b0ba2601
commit 804378e8f7
2 changed files with 14 additions and 1 deletions

View File

@ -107,7 +107,14 @@ fn execute_instruction(
executable_accounts,
program_accounts,
tick_height,
)?;
)
.map_err(|err| match err {
ProgramError::CustomError(mut error) => {
error.truncate(32);
ProgramError::CustomError(error)
}
e => e,
})?;
// Verify the instruction
for ((pre_program_id, pre_lamports, pre_userdata), post_account) in