fix: update example to new sdk api (#146)
This commit is contained in:
19
web3.js/examples/bpf-c-noop/src/noop/noop.c
Normal file
19
web3.js/examples/bpf-c-noop/src/noop/noop.c
Normal 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, ¶ms, SOL_ARRAY_SIZE(ka))) {
|
||||
return false;
|
||||
}
|
||||
sol_log_params(¶ms);
|
||||
return true;
|
||||
}
|
Reference in New Issue
Block a user