Skip to main content

TransactionError

Enum TransactionError 

Source
pub enum TransactionError {
Show 31 variants AccountInUse, AccountLoadedTwice, AccountNotFound, ProgramAccountNotFound, InsufficientFundsForFee, InvalidAccountForFee, AlreadyProcessed, TimestampTooStale, TimestampInFuture, InstructionError(u8, InstructionError), InvalidAccountIndex, SignatureFailure, InvalidProgramForExecution, SanitizeFailure, AccountBorrowOutstanding, WouldExceedMaxBlockCostLimit, UnsupportedVersion, InvalidWritableAccount, WouldExceedMaxAccountCostLimit, WouldExceedAccountDataBlockLimit, TooManyAccountLocks, InvalidRentPayingAccount, WouldExceedMaxVoteCostLimit, DuplicateInstruction(u8), InsufficientFundsForRent { account_index: u8, }, MaxLoadedAccountsDataSizeExceeded, InvalidLoadedAccountsDataSizeLimit, ResanitizationNeeded, UnbalancedTransaction, ProgramCacheHitMaxLimit, SerializationFailure,
}
Expand description

Reasons a transaction might be rejected.

This enum represents all the possible ways a transaction can fail during processing, validation, or execution.

Variants§

§

AccountInUse

An account is already being processed in another transaction in a way that does not support parallelism

§

AccountLoadedTwice

A Pubkey appears twice in the transaction’s account_keys. Instructions can reference Pubkeys more than once but the message must contain a list with no duplicate keys

§

AccountNotFound

Attempt to debit an account but found no record of a prior credit.

§

ProgramAccountNotFound

Attempt to load a program that does not exist

§

InsufficientFundsForFee

The from Pubkey does not have sufficient balance to pay the fee to schedule the transaction

§

InvalidAccountForFee

This account may not be used to pay transaction fees

§

AlreadyProcessed

The bank has seen this transaction before. This can occur under normal operation when a UDP packet is duplicated, as a user error from a client not updating its recent_blockhash, or as a double-spend attack.

§

TimestampTooStale

The transaction is too stale (seconds since UNIX_EPOCH).

§

TimestampInFuture

The transaction is too far in the future (seconds since UNIX_EPOCH).

§

InstructionError(u8, InstructionError)

An error occurred while processing an instruction. The first element of the tuple indicates the instruction index in which the error occurred.

§

InvalidAccountIndex

Transaction contains an invalid account reference

§

SignatureFailure

Transaction did not pass signature verification

§

InvalidProgramForExecution

This program may not be used for executing instructions

§

SanitizeFailure

Transaction failed to sanitize accounts offsets correctly implies that account locks are not taken for this TX, and should not be unlocked.

§

AccountBorrowOutstanding

Transaction processing left an account with an outstanding borrowed reference

§

WouldExceedMaxBlockCostLimit

Transaction would exceed max Block Cost Limit

§

UnsupportedVersion

Transaction version is unsupported

§

InvalidWritableAccount

Transaction loads a writable account that cannot be written

§

WouldExceedMaxAccountCostLimit

Transaction would exceed max account limit within the block

§

WouldExceedAccountDataBlockLimit

Transaction would exceed account data limit within the block

§

TooManyAccountLocks

Transaction locked too many accounts

§

InvalidRentPayingAccount

Transaction leaves an account with a lower balance than rent-exempt minimum

§

WouldExceedMaxVoteCostLimit

Transaction would exceed max Vote Cost Limit

§

DuplicateInstruction(u8)

Transaction contains a duplicate instruction that is not allowed

§

InsufficientFundsForRent

Transaction results in an account with insufficient funds for rent

Fields

§account_index: u8
§

MaxLoadedAccountsDataSizeExceeded

Transaction exceeded max loaded accounts data size cap

§

InvalidLoadedAccountsDataSizeLimit

LoadedAccountsDataSizeLimit set for transaction must be greater than 0.

§

ResanitizationNeeded

Sanitized transaction differed before/after feature activiation. Needs to be resanitized.

§

UnbalancedTransaction

The total balance before the transaction does not equal the total balance after the transaction

§

ProgramCacheHitMaxLimit

Program cache hit max limit.

§

SerializationFailure

Failed to serialize transaction instructions.

Trait Implementations§

Source§

impl Clone for TransactionError

Source§

fn clone(&self) -> TransactionError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransactionError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TransactionError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TransactionError

Source§

fn eq(&self, other: &TransactionError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TransactionError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for TransactionError

Source§

impl StructuralPartialEq for TransactionError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,