Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to the latest plugin SDK #21

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethereum-plugin-sdk
8 changes: 2 additions & 6 deletions src/handle_provide_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,19 @@ int find_lr_known_strategy(const char address[ADDRESS_STR_LEN]) {
void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t *context) {
uint8_t buffer[ADDRESS_LENGTH];
char address_buffer[ADDRESS_STR_LEN];
cx_sha3_t sha3;

switch (context->next_param) {
case LR_DEPOSIT_INTO_STRATEGY_STRATEGY:
copy_address(buffer, msg->parameter, sizeof(buffer));
getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), &sha3, 0);
getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), 0);
context->param_data.lr_deposit.strategy_to_display =
find_lr_known_strategy(address_buffer);

context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN;
break;
case LR_DEPOSIT_INTO_STRATEGY_TOKEN:
copy_address(buffer, msg->parameter, sizeof(buffer));
getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), &sha3, 0);
getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), 0);
context->param_data.lr_deposit.erc20_to_display = find_lr_known_erc20(address_buffer);

context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT;
Expand All @@ -98,8 +97,6 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t
}

void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) {
cx_sha3_t sha3;

// queueWithdrawal(uint256[],address[],uint256[],address,bool
// example for queue withdrawal with 2 strategies indexes, contracts and shares
// [0] selector
Expand Down Expand Up @@ -164,7 +161,6 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con
getEthDisplayableAddress(buffer,
context->param_data.lr_queue_withdrawal.withdrawer,
sizeof(context->param_data.lr_queue_withdrawal.withdrawer),
&sha3,
0);
context->next_param = LR_QUEUE_WITHDRAWAL_UNDELEGATEIFPOSSIBLE;
break;
Expand Down
Loading