Expose tick_height to bpf programs

This commit is contained in:
Michael Vines
2018-11-13 19:54:41 -08:00
parent 5a8938209b
commit 1fda4b77ef
5 changed files with 33 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ extern bool entrypoint(const uint8_t *input) {
const uint8_t *data;
uint64_t data_len;
if (!sol_deserialize(input, ka, NUM_KA, NULL, &data, &data_len)) {
if (!sol_deserialize(input, ka, NUM_KA, NULL, &data, &data_len, NULL)) {
return false;
}

View File

@@ -9,12 +9,13 @@ extern bool entrypoint(const uint8_t *input) {
uint64_t ka_len;
const uint8_t *data;
uint64_t data_len;
SolClusterInfo info;
sol_log("noop++");
if (!sol_deserialize(input, ka, SOL_ARRAY_SIZE(ka), &ka_len, &data, &data_len)) {
sol_log(__FILE__);
if (!sol_deserialize(input, ka, SOL_ARRAY_SIZE(ka), &ka_len, &data, &data_len, &info)) {
return false;
}
sol_log_64(info.tick_height, 0, 0, 0, 0);
// Log the provided account keys and instruction input data. In the case of
// the no-op program, no account keys or input data are expected but real

View File

@@ -9,12 +9,14 @@ extern bool entrypoint(const uint8_t *input) {
uint64_t ka_len;
const uint8_t *data;
uint64_t data_len;
SolClusterInfo info;
sol_log(__FILE__);
if (!sol_deserialize(input, ka, SOL_ARRAY_SIZE(ka), &ka_len, &data, &data_len)) {
if (!sol_deserialize(input, ka, SOL_ARRAY_SIZE(ka), &ka_len, &data, &data_len, &info)) {
return false;
}
sol_log_64(info.tick_height, 0, 0, 0, 0);
// Log the provided account keys and instruction input data. In the case of
// the no-op program, no account keys or input data are expected but real