check program owners (#15495)

* check program owners

* BankSlotDelta should change because InstructionError variant added

Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
sakridge
2021-02-26 14:21:34 -08:00
committed by GitHub
parent d47f1fae40
commit 8399851d11
10 changed files with 118 additions and 18 deletions

View File

@@ -116,4 +116,5 @@ pub enum InstructionErrorType {
IncorrectAuthority = 43,
BorshIoError = 44,
AccountNotRentExempt = 45,
InvalidAccountOwner = 46,
}

View File

@@ -483,6 +483,9 @@ impl TryFrom<tx_by_addr::TransactionError> for TransactionError {
41 => InstructionError::ProgramFailedToCompile,
42 => InstructionError::Immutable,
43 => InstructionError::IncorrectAuthority,
44 => InstructionError::BorshIoError(String::new()),
45 => InstructionError::AccountNotRentExempt,
46 => InstructionError::InvalidAccountOwner,
_ => return Err("Invalid InstructionError"),
};
@@ -706,6 +709,9 @@ impl From<TransactionError> for tx_by_addr::TransactionError {
InstructionError::AccountNotRentExempt => {
tx_by_addr::InstructionErrorType::AccountNotRentExempt
}
InstructionError::InvalidAccountOwner => {
tx_by_addr::InstructionErrorType::InvalidAccountOwner
}
} as i32,
custom: match instruction_error {
InstructionError::Custom(custom) => {

View File

@@ -95,6 +95,7 @@ enum InstructionErrorType {
INCORRECT_AUTHORITY = 43;
BORSH_IO_ERROR = 44;
ACCOUNT_NOT_RENT_EXEMPT = 45;
INVALID_ACCOUNT_OWNER = 46;
}
message UnixTimestamp {