Add BPF program entrypoint return type (#8111)
This commit is contained in:
@ -7,19 +7,20 @@ use std::{
|
||||
cell::RefCell,
|
||||
mem::size_of,
|
||||
rc::Rc,
|
||||
// Hide Result from bindgen gets confused about generics in non-generic type declarations
|
||||
result::Result as ResultGeneric,
|
||||
slice::{from_raw_parts, from_raw_parts_mut},
|
||||
};
|
||||
|
||||
pub type ProgramResult = ResultGeneric<(), ProgramError>;
|
||||
|
||||
/// User implemented function to process an instruction
|
||||
///
|
||||
/// program_id: Program ID of the currently executing program
|
||||
/// accounts: Accounts passed as part of the instruction
|
||||
/// instruction_data: Instruction data
|
||||
pub type ProcessInstruction = fn(
|
||||
program_id: &Pubkey,
|
||||
accounts: &[AccountInfo],
|
||||
instruction_data: &[u8],
|
||||
) -> Result<(), ProgramError>;
|
||||
pub type ProcessInstruction =
|
||||
fn(program_id: &Pubkey, accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResult;
|
||||
|
||||
/// Programs indicate success with a return value of 0
|
||||
pub const SUCCESS: u64 = 0;
|
||||
|
Reference in New Issue
Block a user