Add BPF program entrypoint return type (#8111)

This commit is contained in:
Jack May
2020-02-04 12:25:42 -08:00
committed by GitHub
parent 78f6ddc5b7
commit b6d09f1901
6 changed files with 21 additions and 19 deletions

View File

@ -6,7 +6,9 @@ use num_traits::FromPrimitive;
use solana_sdk::{
account_info::AccountInfo,
entrypoint, info,
entrypoint,
entrypoint::ProgramResult,
info,
instruction_processor_utils::DecodeError,
program_error::{PrintProgramError, ProgramError},
pubkey::Pubkey,
@ -48,9 +50,7 @@ fn process_instruction(
_program_id: &Pubkey,
accounts: &[AccountInfo],
instruction_data: &[u8],
) -> Result<(), ProgramError> {
ProgramError::CustomError(42).print::<MyError>();
) -> ProgramResult {
match instruction_data[0] {
1 => {
info!("return success");