Limit number of accounts that a transaction can lock (#22201)
This commit is contained in:
@ -46,6 +46,7 @@ enum TransactionErrorType {
|
||||
INVALID_WRITABLE_ACCOUNT = 19;
|
||||
WOULD_EXCEED_MAX_ACCOUNT_COST_LIMIT = 20;
|
||||
WOULD_EXCEED_MAX_ACCOUNT_DATA_COST_LIMIT = 21;
|
||||
TOO_MANY_ACCOUNT_LOCKS = 22;
|
||||
}
|
||||
|
||||
message InstructionError {
|
||||
|
@ -569,6 +569,7 @@ impl TryFrom<tx_by_addr::TransactionError> for TransactionError {
|
||||
19 => TransactionError::InvalidWritableAccount,
|
||||
20 => TransactionError::WouldExceedMaxAccountCostLimit,
|
||||
21 => TransactionError::WouldExceedMaxAccountDataCostLimit,
|
||||
22 => TransactionError::TooManyAccountLocks,
|
||||
_ => return Err("Invalid TransactionError"),
|
||||
})
|
||||
}
|
||||
@ -642,6 +643,9 @@ impl From<TransactionError> for tx_by_addr::TransactionError {
|
||||
TransactionError::WouldExceedMaxAccountDataCostLimit => {
|
||||
tx_by_addr::TransactionErrorType::WouldExceedMaxAccountDataCostLimit
|
||||
}
|
||||
TransactionError::TooManyAccountLocks => {
|
||||
tx_by_addr::TransactionErrorType::TooManyAccountLocks
|
||||
}
|
||||
} as i32,
|
||||
instruction_error: match transaction_error {
|
||||
TransactionError::InstructionError(index, ref instruction_error) => {
|
||||
|
Reference in New Issue
Block a user