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

20 lines
425 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) {
2018-10-31 23:21:21 -07:00
SolKeyedAccounts ka[1];
uint64_t ka_len;
const uint8_t *data;
2018-10-29 15:41:14 -07:00
uint64_t data_len;
2018-10-31 23:21:21 -07:00
if (!sol_deserialize(input, ka, SOL_ARRAY_SIZE(ka), &ka_len, &data, &data_len)) {
2018-10-29 15:41:14 -07:00
return false;
}
2018-11-06 15:53:12 -08:00
sol_log_params(ka_len, ka, data, data_len);
2018-10-29 15:41:14 -07:00
return true;
}