Skip to content

Commit

Permalink
🐛 Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nagdahimanshu committed Apr 30, 2024
1 parent 972ea4a commit 4cf6ef9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/handle_provide_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ static void handle_reward_create_position(ethPluginProvideParameter_t *msg, cont
}
}

uint16_t counter = 0;
static void handle_lock_ids_array(ethPluginProvideParameter_t *msg, context_t *context) {
switch (context->next_param) {
case OFFSET:
Expand All @@ -112,24 +111,26 @@ static void handle_lock_ids_array(ethPluginProvideParameter_t *msg, context_t *c
context->next_param = LOCK_ID;
break;
case LOCK_ID:
if (counter == context->lisk.body.reward.lock_ids_len) {
if (context->lisk.body.reward.counter == context->lisk.body.reward.lock_ids_len) {
context->next_param = NONE;
}
copy_parameter(context->lisk.body.reward.lock_id[counter].value,
msg->parameter,
INT256_LENGTH);
copy_parameter(
context->lisk.body.reward.lock_id[context->lisk.body.reward.counter].value,
msg->parameter,
INT256_LENGTH);
if (context->lisk.body.reward.lock_ids_len > 1) {
context->next_param = LOCK_ID_NEXT;
counter++;
context->lisk.body.reward.counter++;
} else {
context->next_param = NONE;
}
break;
case LOCK_ID_NEXT:
copy_parameter(context->lisk.body.reward.lock_id[counter].value,
msg->parameter,
INT256_LENGTH);
counter++;
copy_parameter(
context->lisk.body.reward.lock_id[context->lisk.body.reward.counter].value,
msg->parameter,
INT256_LENGTH);
context->lisk.body.reward.counter++;
context->next_param = LOCK_ID;
break;
case NONE:
Expand Down
1 change: 1 addition & 0 deletions src/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ typedef struct {
struct {
uint16_t lock_ids_len;
lock_t lock_id[4];
uint8_t counter;
} reward;
} body;
} lisk_t;
Expand Down

0 comments on commit 4cf6ef9

Please sign in to comment.