Files
solana/web3.js/examples/bpf-c-noop/src/noop.c

24 lines
525 B
C
Raw Normal View History

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