Add InstructionError for runtime instruction errors

This commit is contained in:
Greg Fitzgerald
2019-03-13 11:46:49 -06:00
parent 959961b596
commit c14cce4c85
9 changed files with 79 additions and 53 deletions

View File

@@ -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)
))
);
}