Skip to content
Open
15 changes: 11 additions & 4 deletions auction-server/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ pub enum InstructionError {
UnsupportedSplTokenInstruction(String),
InvalidAssociatedTokenAccountInstruction(String),
UnsupportedAssociatedTokenAccountInstruction(AssociatedTokenAccountInstruction),
UnsupportedProgram(Pubkey),
TransferInstructionNotAllowed,
CloseAccountInstructionNotAllowed,
InvalidTransferInstructionsCount,
Expand All @@ -132,6 +131,8 @@ pub enum InstructionError {
MissingCreateAtaInstruction(Pubkey),
InvalidMemoInstructionCount { expected: usize, found: usize },
InvalidMemoString { expected: String, found: String },
UnsupportedInvocationOfUserWallet,
UnapprovedProgramId(Pubkey),
}

impl std::fmt::Display for InstructionError {
Expand All @@ -155,9 +156,6 @@ impl std::fmt::Display for InstructionError {
"Unsupported associated token account instruction {:?}",
instruction
),
InstructionError::UnsupportedProgram(program) => {
write!(f, "Unsupported program {}", program)
}
InstructionError::TransferInstructionNotAllowed => {
write!(f, "Transfer instruction is not allowed")
}
Expand Down Expand Up @@ -278,6 +276,15 @@ impl std::fmt::Display for InstructionError {
expected, found
)
}
InstructionError::UnsupportedInvocationOfUserWallet => {
write!(
f,
"Invocation of user wallet is not supported in this instruction"
)
}
InstructionError::UnapprovedProgramId(program_id) => {
write!(f, "Instruction has unapproved program id: {:?}", program_id)
}
}
}
}
Expand Down
Loading
Loading