Remove program error footgun and cleaner developer experience (#8042)
This commit is contained in:
@ -8,6 +8,7 @@ use log::*;
|
||||
use solana_rbpf::{memory_region::MemoryRegion, EbpfVm};
|
||||
use solana_sdk::{
|
||||
account::KeyedAccount,
|
||||
entrypoint::SUCCESS,
|
||||
instruction::InstructionError,
|
||||
instruction_processor_utils::{is_executable, limited_deserialize, next_keyed_account},
|
||||
loader_instruction::LoaderInstruction,
|
||||
@ -145,9 +146,7 @@ pub fn process_instruction(
|
||||
info!("Call BPF program");
|
||||
match vm.execute_program(parameter_bytes.as_slice(), &[], &[heap_region]) {
|
||||
Ok(status) => {
|
||||
// ignore upper 32bits if any, programs only return lower 32bits
|
||||
let status = status as u32;
|
||||
if status != 0 {
|
||||
if status != SUCCESS {
|
||||
let error: InstructionError = status.into();
|
||||
warn!("BPF program failed: {:?}", error);
|
||||
return Err(error);
|
||||
|
Reference in New Issue
Block a user