BPF rust language updates (#4752)
This commit is contained in:
@@ -6,22 +6,14 @@
|
||||
extern crate solana_sdk_bpf_utils;
|
||||
|
||||
use byteorder::{ByteOrder, LittleEndian};
|
||||
use solana_sdk_bpf_utils::entrypoint;
|
||||
use solana_sdk_bpf_utils::entrypoint::*;
|
||||
use solana_sdk_bpf_utils::log::*;
|
||||
use solana_sdk_bpf_utils::{entrypoint, info};
|
||||
|
||||
entrypoint!(process_instruction);
|
||||
fn process_instruction(
|
||||
ka: &mut [Option<SolKeyedAccount>; MAX_ACCOUNTS],
|
||||
_info: &SolClusterInfo,
|
||||
_data: &[u8],
|
||||
) -> bool {
|
||||
sol_log("Tick Height:");
|
||||
if let Some(k) = &ka[2] {
|
||||
let tick_height = LittleEndian::read_u64(k.data);
|
||||
assert_eq!(10u64, tick_height);
|
||||
sol_log("Success");
|
||||
return true;
|
||||
}
|
||||
panic!();
|
||||
fn process_instruction(ka: &mut [SolKeyedAccount], _info: &SolClusterInfo, _data: &[u8]) -> bool {
|
||||
let tick_height = LittleEndian::read_u64(ka[2].data);
|
||||
assert_eq!(10u64, tick_height);
|
||||
|
||||
info!("Success");
|
||||
true
|
||||
}
|
||||
|
Reference in New Issue
Block a user