Move ProgramError into sdk/

This commit is contained in:
Michael Vines
2018-12-03 12:26:23 -08:00
parent 68e99c18c0
commit 777a0a858e
9 changed files with 27 additions and 27 deletions

View File

@ -28,3 +28,24 @@ macro_rules! solana_entrypoint(
}
)
);
/// Reasons a program might have rejected an instruction.
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum ProgramError {
/// Contract's transactions resulted in an account with a negative balance
/// The difference from InsufficientFundsForFee is that the transaction was executed by the
/// contract
ResultWithNegativeTokens,
/// The program returned an error
GenericError,
/// Program's instruction token balance does not equal the balance after the instruction
UnbalancedInstruction,
/// Program modified an account's program id
ModifiedProgramId,
/// Program spent the tokens of an account that doesn't belong to it
ExternalAccountTokenSpend,
}