Sdk: start to appease clippy's integer arithmetic check (#15736)
* Move to module-level clippy allowance * Fix stake_weighted_timestamp math * Fix genesis_config * Fix shred_version * Fix hard_forks * Fix process_instruction * Add ArithmeticOverflow ix error * Fix nonce_keyed_account * Update BankSlotDelta frozen abi due to new ix error
This commit is contained in:
@@ -117,4 +117,5 @@ pub enum InstructionErrorType {
|
||||
BorshIoError = 44,
|
||||
AccountNotRentExempt = 45,
|
||||
InvalidAccountOwner = 46,
|
||||
ArithmeticOverflow = 47,
|
||||
}
|
||||
|
@@ -509,6 +509,7 @@ impl TryFrom<tx_by_addr::TransactionError> for TransactionError {
|
||||
44 => InstructionError::BorshIoError(String::new()),
|
||||
45 => InstructionError::AccountNotRentExempt,
|
||||
46 => InstructionError::InvalidAccountOwner,
|
||||
47 => InstructionError::ArithmeticOverflow,
|
||||
_ => return Err("Invalid InstructionError"),
|
||||
};
|
||||
|
||||
@@ -735,6 +736,9 @@ impl From<TransactionError> for tx_by_addr::TransactionError {
|
||||
InstructionError::InvalidAccountOwner => {
|
||||
tx_by_addr::InstructionErrorType::InvalidAccountOwner
|
||||
}
|
||||
InstructionError::ArithmeticOverflow => {
|
||||
tx_by_addr::InstructionErrorType::ArithmeticOverflow
|
||||
}
|
||||
} as i32,
|
||||
custom: match instruction_error {
|
||||
InstructionError::Custom(custom) => {
|
||||
|
@@ -96,6 +96,7 @@ enum InstructionErrorType {
|
||||
BORSH_IO_ERROR = 44;
|
||||
ACCOUNT_NOT_RENT_EXEMPT = 45;
|
||||
INVALID_ACCOUNT_OWNER = 46;
|
||||
ARITHMETIC_OVERFLOW = 47;
|
||||
}
|
||||
|
||||
message UnixTimestamp {
|
||||
|
Reference in New Issue
Block a user