solana-program-library/stake-pool/program/src/entrypoint.rs

22 lines
595 B
Rust
Raw Normal View History

//! Program entrypoint
use crate::{error::Error, processor::Processor};
use solana_program::{
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult,
program_error::PrintProgramError, pubkey::Pubkey,
};
entrypoint!(process_instruction);
2020-11-01 00:22:04 -07:00
fn process_instruction(
program_id: &Pubkey,
2020-11-01 00:22:04 -07:00
accounts: &[AccountInfo],
instruction_data: &[u8],
) -> ProgramResult {
if let Err(error) = Processor::process(program_id, accounts, instruction_data) {
// catch the error so we can print it
error.print::<Error>();
return Err(error);
}
Ok(())
}