@ -11,6 +11,8 @@ edition = "2018"
|
||||
[dependencies]
|
||||
bincode = "1.1.3"
|
||||
log = "0.4.2"
|
||||
num-derive = "0.2"
|
||||
num-traits = "0.2"
|
||||
serde = "1.0.90"
|
||||
serde_derive = "1.0.90"
|
||||
solana-logger = { path = "../../logger", version = "0.14.0" }
|
||||
|
@ -1,15 +1,23 @@
|
||||
use log::*;
|
||||
use num_derive::FromPrimitive;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use solana_sdk::account::KeyedAccount;
|
||||
use solana_sdk::instruction_processor_utils::DecodeError;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
|
||||
#[derive(Serialize, Debug, PartialEq)]
|
||||
#[derive(Serialize, Debug, PartialEq, FromPrimitive)]
|
||||
pub enum TokenError {
|
||||
InvalidArgument,
|
||||
InsufficentFunds,
|
||||
NotOwner,
|
||||
}
|
||||
|
||||
impl<T> DecodeError<T> for TokenError {
|
||||
fn type_of(&self) -> &'static str {
|
||||
"TokenError"
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for TokenError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(f, "error")
|
||||
|
Reference in New Issue
Block a user