Skip to content

Commit

Permalink
fix: I7
Browse files Browse the repository at this point in the history
  • Loading branch information
loicttn committed May 23, 2024
1 parent 45976d1 commit bf17198
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/provide_parameter/eigenlayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,23 +652,25 @@ void handle_lr_complete_queued_withdrawals(ethPluginProvideParameter_t *msg, con
getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), 0);

uint8_t strategy_index = find_lr_known_strategy(address_buffer);
if (params->strategies_count < MAX_DISPLAYABLE_LR_STRATEGIES_COUNT) {
uint8_t withdrawal = params->withdrawals_count;

uint8_t strategy = (strategy_index != UNKNOWN_LR_STRATEGY)
? strategy_index
: UNKNOWN_LR_STRATEGY;

if (withdrawal > 16 || strategy > 16) {
PRINTF("INVALID WITHDRAWAL #: %d STRATEGY #: %d\n", withdrawal, strategy);
msg->result = ETH_PLUGIN_RESULT_ERROR;
return;
}

params->strategies[params->strategies_count] =
(withdrawal << 4) | (strategy & 0x0F);
;
if (params->strategies_count >= MAX_DISPLAYABLE_LR_STRATEGIES_COUNT) {
PRINTF("Too many strategies to display, reverting\n");
msg->result = ETH_PLUGIN_RESULT_ERROR;
return;
}
uint8_t withdrawal = params->withdrawals_count;

uint8_t strategy =
(strategy_index != UNKNOWN_LR_STRATEGY) ? strategy_index : UNKNOWN_LR_STRATEGY;

if (withdrawal > 16 || strategy > 16) {
PRINTF("INVALID WITHDRAWAL #: %d STRATEGY #: %d\n", withdrawal, strategy);
msg->result = ETH_PLUGIN_RESULT_ERROR;
return;
}

params->strategies[params->strategies_count] =
(withdrawal << 4) | (strategy & 0x0F);
;
}

// we just processed one strategy item
Expand Down

0 comments on commit bf17198

Please sign in to comment.