Merge InstructionError and ProgramError
From the user's perspective, it's just an instruction error. For program-specific errors, we still have InstructionError::CustomError.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use bincode::serialize;
|
||||
use log::*;
|
||||
use solana_sdk::account::KeyedAccount;
|
||||
use solana_sdk::native_program::ProgramError;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::solana_entrypoint;
|
||||
use solana_sdk::transaction::InstructionError;
|
||||
|
||||
mod token_program;
|
||||
|
||||
@@ -13,11 +13,11 @@ fn entrypoint(
|
||||
info: &mut [KeyedAccount],
|
||||
input: &[u8],
|
||||
_tick_height: u64,
|
||||
) -> Result<(), ProgramError> {
|
||||
) -> Result<(), InstructionError> {
|
||||
solana_logger::setup();
|
||||
|
||||
token_program::TokenProgram::process(program_id, info, input).map_err(|e| {
|
||||
error!("error: {:?}", e);
|
||||
ProgramError::CustomError(serialize(&e).unwrap())
|
||||
InstructionError::CustomError(serialize(&e).unwrap())
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user