fix: update example to new sdk api (#146)

This commit is contained in:
Jack May
2019-01-23 16:14:11 -08:00
committed by Michael Vines
parent be82e50862
commit 7d3f671c3d
3 changed files with 20 additions and 24 deletions

View File

@ -1,23 +0,0 @@
/**
* @brief Example C-based BPF program that prints out the parameters
* passed to it
*/
#include <solana_sdk.h>
extern bool entrypoint(const uint8_t *input) {
SolKeyedAccount ka[1];
uint64_t ka_len;
const uint8_t *data;
uint64_t data_len;
SolClusterInfo info;
sol_log("Hello World");
if (!sol_deserialize(input, ka, SOL_ARRAY_SIZE(ka), &ka_len, &data, &data_len, &info)) {
return false;
}
sol_log_64(info.tick_height, 0, 0, 0, 0);
sol_log_params(ka, ka_len, data, data_len);
return true;
}

View File

@ -0,0 +1,19 @@
/**
* @brief Example C-based BPF program that prints out the parameters
* passed to it
*/
#include <solana_sdk.h>
extern bool entrypoint(const uint8_t *input) {
SolKeyedAccount ka[1];
SolParameters params = (SolParameters) { .ka = ka };
sol_log("Hello World");
if (!sol_deserialize(input, &params, SOL_ARRAY_SIZE(ka))) {
return false;
}
sol_log_params(&params);
return true;
}

View File

@ -24,7 +24,7 @@
"bin": {
"solana-localnet": "bin/localnet.sh"
},
"testnetDefaultChannel": "beta",
"testnetDefaultChannel": "edge",
"files": [
"/bin",
"/doc",