Update programs using simple error mapping to use CustomError
This commit is contained in:
committed by
Greg Fitzgerald
parent
db5370c5df
commit
1a9ef37251
@@ -2,7 +2,7 @@ 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::{custom_error, solana_entrypoint};
|
||||
|
||||
mod token_program;
|
||||
|
||||
@@ -17,6 +17,6 @@ fn entrypoint(
|
||||
|
||||
token_program::TokenProgram::process(program_id, info, input).map_err(|err| {
|
||||
error!("error: {:?}", err);
|
||||
ProgramError::GenericError
|
||||
ProgramError::CustomError(custom_error!(err))
|
||||
})
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ use solana_sdk::account::KeyedAccount;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use std;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Serialize, Debug, PartialEq)]
|
||||
pub enum Error {
|
||||
InvalidArgument,
|
||||
InsufficentFunds,
|
||||
|
Reference in New Issue
Block a user