2019-06-12 13:04:53 -07:00
|
|
|
//! @brief Example Rust-based BPF program tests loop iteration
|
|
|
|
|
|
|
|
#![no_std]
|
2019-06-20 07:43:31 -07:00
|
|
|
#![allow(unused_attributes)]
|
2019-06-12 13:04:53 -07:00
|
|
|
|
|
|
|
mod helper;
|
|
|
|
|
|
|
|
extern crate solana_sdk_bpf_utils;
|
|
|
|
|
2019-06-20 16:07:12 -07:00
|
|
|
use solana_sdk_bpf_utils::info;
|
2019-06-12 13:04:53 -07:00
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
pub extern "C" fn entrypoint(_input: *mut u8) -> bool {
|
2019-06-20 16:07:12 -07:00
|
|
|
info!("call same package");
|
2019-06-12 13:04:53 -07:00
|
|
|
assert_eq!(crate::helper::many_args(1, 2, 3, 4, 5, 6, 7, 8, 9), 45);
|
2019-06-20 16:07:12 -07:00
|
|
|
info!("call another package");
|
2019-06-12 13:04:53 -07:00
|
|
|
assert_eq!(
|
|
|
|
solana_bpf_rust_many_args_dep::many_args(1, 2, 3, 4, 5, 6, 7, 8, 9),
|
|
|
|
45
|
|
|
|
);
|
|
|
|
|
2019-06-20 16:07:12 -07:00
|
|
|
info!("Success");
|
2019-06-12 13:04:53 -07:00
|
|
|
true
|
|
|
|
}
|