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-11-27 17:07:04 -08:00
|
|
|
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;
|
2018-11-14 10:30:52 -08:00
|
|
|
SolClusterInfo info;
|
2018-10-29 15:41:14 -07:00
|
|
|
|
2018-11-07 08:52:01 -08:00
|
|
|
sol_log("Hello World");
|
|
|
|
|
2018-11-14 10:30:52 -08:00
|
|
|
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;
|
|
|
|
}
|
2018-11-14 10:30:52 -08:00
|
|
|
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;
|
|
|
|
}
|