Split SDK's BPF Rust-utils (#4369)

This commit is contained in:
Jack May
2019-05-21 13:39:27 -07:00
committed by GitHub
parent 1cbd2372fc
commit 2f7561e4ee
9 changed files with 495 additions and 475 deletions

View File

@ -1,4 +1,8 @@
#!/usr/bin/env bash
bpf_sdk=../../../sdk/bpf
./"$bpf_sdk"/rust-utils/build.sh "$PWD"/"$1"
if [ "$#" -ne 1 ]; then
echo "Error: Must provide name of the project to build"
exit 1
fi
./../../../sdk/bpf/rust-utils/build.sh "$PWD"/"$1"

View File

@ -1,4 +1,8 @@
#!/usr/bin/env bash
bpf_sdk=../../../sdk/bpf
./"$bpf_sdk"/rust-utils/clean.sh "$PWD"/"$1"
if [ "$#" -ne 1 ]; then
echo "Error: Must provide the full path to the project to clean"
exit 1
fi
./../../../sdk/bpf/rust-utils/clean.sh "$PWD"/"$1"

View File

@ -1,5 +1,10 @@
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "Error: Must provide the full path to the project to dump"
exit 1
fi
./clean.sh "$1"
./build.sh "$1"

View File

@ -4,7 +4,7 @@
extern crate solana_sdk_bpf_utils;
use solana_sdk_bpf_utils::*;
use solana_sdk_bpf_utils::log::*;
#[no_mangle]
pub extern "C" fn entrypoint(_input: *mut u8) -> bool {

View File

@ -4,7 +4,9 @@
extern crate solana_sdk_bpf_utils;
use solana_sdk_bpf_utils::*;
use solana_sdk_bpf_utils::entrypoint;
use solana_sdk_bpf_utils::entrypoint::*;
use solana_sdk_bpf_utils::log::*;
struct SStruct {
x: u64,
@ -17,7 +19,7 @@ fn return_sstruct() -> SStruct {
SStruct { x: 1, y: 2, z: 3 }
}
solana_entrypoint!(process_instruction);
entrypoint!(process_instruction);
fn process_instruction(
ka: &mut [Option<SolKeyedAccount>; MAX_ACCOUNTS],
info: &SolClusterInfo,