1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
use {
crate::{
instruction::InstructionError, message::SanitizeMessageError, sanitize::SanitizeError,
},
serde::Serialize,
thiserror::Error,
};
#[derive(
Error, Serialize, Deserialize, Debug, PartialEq, Eq, Clone, AbiExample, AbiEnumVisitor,
)]
pub enum TransactionError {
#[error("Account in use")]
AccountInUse,
#[error("Account loaded twice")]
AccountLoadedTwice,
#[error("Attempt to debit an account but found no record of a prior credit.")]
AccountNotFound,
#[error("Attempt to load a program that does not exist")]
ProgramAccountNotFound,
#[error("Insufficient funds for fee")]
InsufficientFundsForFee,
#[error("This account may not be used to pay transaction fees")]
InvalidAccountForFee,
#[error("This transaction has already been processed")]
AlreadyProcessed,
#[error("Blockhash not found")]
BlockhashNotFound,
#[error("Error processing Instruction {0}: {1}")]
InstructionError(u8, InstructionError),
#[error("Loader call chain is too deep")]
CallChainTooDeep,
#[error("Transaction requires a fee but has no signature present")]
MissingSignatureForFee,
#[error("Transaction contains an invalid account reference")]
InvalidAccountIndex,
#[error("Transaction did not pass signature verification")]
SignatureFailure,
#[error("This program may not be used for executing instructions")]
InvalidProgramForExecution,
#[error("Transaction failed to sanitize accounts offsets correctly")]
SanitizeFailure,
#[error("Transactions are currently disabled due to cluster maintenance")]
ClusterMaintenance,
#[error("Transaction processing left an account with an outstanding borrowed reference")]
AccountBorrowOutstanding,
#[error("Transaction would exceed max Block Cost Limit")]
WouldExceedMaxBlockCostLimit,
#[error("Transaction version is unsupported")]
UnsupportedVersion,
#[error("Transaction loads a writable account that cannot be written")]
InvalidWritableAccount,
#[error("Transaction would exceed max account limit within the block")]
WouldExceedMaxAccountCostLimit,
#[error("Transaction would exceed account data limit within the block")]
WouldExceedAccountDataBlockLimit,
#[error("Transaction locked too many accounts")]
TooManyAccountLocks,
#[error("Transaction loads an address table account that doesn't exist")]
AddressLookupTableNotFound,
#[error("Transaction loads an address table account with an invalid owner")]
InvalidAddressLookupTableOwner,
#[error("Transaction loads an address table account with invalid data")]
InvalidAddressLookupTableData,
#[error("Transaction address table lookup uses an invalid index")]
InvalidAddressLookupTableIndex,
#[error("Transaction leaves an account with a lower balance than rent-exempt minimum")]
InvalidRentPayingAccount,
#[error("Transaction would exceed max Vote Cost Limit")]
WouldExceedMaxVoteCostLimit,
#[error("Transaction would exceed total account data limit")]
WouldExceedAccountDataTotalLimit,
}
impl From<SanitizeError> for TransactionError {
fn from(_: SanitizeError) -> Self {
Self::SanitizeFailure
}
}
impl From<SanitizeMessageError> for TransactionError {
fn from(_err: SanitizeMessageError) -> Self {
Self::SanitizeFailure
}
}