Add InstructionError for runtime instruction errors
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
use solana_runtime::bank::Bank;
|
||||
use solana_runtime::bank::BankError;
|
||||
use solana_runtime::loader_utils::load_program;
|
||||
use solana_runtime::runtime::InstructionError;
|
||||
use solana_sdk::genesis_block::GenesisBlock;
|
||||
use solana_sdk::native_loader;
|
||||
use solana_sdk::native_program::ProgramError;
|
||||
@ -25,6 +26,9 @@ fn test_program_native_failure() {
|
||||
);
|
||||
assert_eq!(
|
||||
bank.process_transaction(&tx),
|
||||
Err(BankError::ProgramError(0, ProgramError::GenericError))
|
||||
Err(BankError::InstructionError(
|
||||
0,
|
||||
InstructionError::ProgramError(ProgramError::GenericError)
|
||||
))
|
||||
);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
use solana_runtime::bank::BankError;
|
||||
use solana_runtime::bank::{Bank, Result};
|
||||
use solana_runtime::runtime::InstructionError;
|
||||
use solana_sdk::genesis_block::GenesisBlock;
|
||||
use solana_sdk::hash::hash;
|
||||
use solana_sdk::native_program::ProgramError;
|
||||
@ -134,6 +135,9 @@ fn test_vote_via_bank_with_no_signature() {
|
||||
|
||||
assert_eq!(
|
||||
result,
|
||||
Err(BankError::ProgramError(1, ProgramError::InvalidArgument))
|
||||
Err(BankError::InstructionError(
|
||||
1,
|
||||
InstructionError::ProgramError(ProgramError::InvalidArgument)
|
||||
))
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user