Skip to content

Commit

Permalink
fix: update example to new sdk api (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmay authored and mvines committed Jun 15, 2020
1 parent be82e50 commit 7d3f671
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
23 changes: 0 additions & 23 deletions web3.js/examples/bpf-c-noop/src/noop.c

This file was deleted.

19 changes: 19 additions & 0 deletions web3.js/examples/bpf-c-noop/src/noop/noop.c
Original file line number Diff line number Diff line change
@@ -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;
}
2 changes: 1 addition & 1 deletion web3.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"bin": {
"solana-localnet": "bin/localnet.sh"
},
"testnetDefaultChannel": "beta",
"testnetDefaultChannel": "edge",
"files": [
"/bin",
"/doc",
Expand Down

0 comments on commit 7d3f671

Please sign in to comment.