Merge InstructionError and ProgramError
From the user's perspective, it's just an instruction error. For program-specific errors, we still have InstructionError::CustomError.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use solana_sdk::account::KeyedAccount;
|
||||
use solana_sdk::native_program::ProgramError;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::solana_entrypoint;
|
||||
use solana_sdk::transaction::InstructionError;
|
||||
|
||||
solana_entrypoint!(entrypoint);
|
||||
fn entrypoint(
|
||||
@@ -9,6 +9,6 @@ fn entrypoint(
|
||||
_keyed_accounts: &mut [KeyedAccount],
|
||||
_data: &[u8],
|
||||
_tick_height: u64,
|
||||
) -> Result<(), ProgramError> {
|
||||
Err(ProgramError::GenericError)
|
||||
) -> Result<(), InstructionError> {
|
||||
Err(InstructionError::GenericError)
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ use solana_runtime::bank::Bank;
|
||||
use solana_runtime::loader_utils::load_program;
|
||||
use solana_sdk::genesis_block::GenesisBlock;
|
||||
use solana_sdk::native_loader;
|
||||
use solana_sdk::native_program::ProgramError;
|
||||
use solana_sdk::transaction::{InstructionError, Transaction, TransactionError};
|
||||
|
||||
#[test]
|
||||
@@ -26,7 +25,7 @@ fn test_program_native_failure() {
|
||||
bank.process_transaction(&tx),
|
||||
Err(TransactionError::InstructionError(
|
||||
0,
|
||||
InstructionError::ProgramError(ProgramError::GenericError)
|
||||
InstructionError::GenericError
|
||||
))
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user