Skip to content

Commit

Permalink
fix: cleanup and tests snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
loicttn committed Feb 6, 2024
1 parent 9e4836b commit 3b12388
Show file tree
Hide file tree
Showing 50 changed files with 17 additions and 20 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t

### LR Deposit Into Strategy

![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00000.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00002.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00003.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00005.png)
![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00000.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00002.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00003.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00005.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00006.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00007.png)

### LR Queue Withdrawal

![](/tests/snapshots/nanos_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00005.png)
![](/tests/snapshots/nanos_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00005.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00006.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00007.png)

### LR Complete Queued Withdrawal

Expand Down Expand Up @@ -192,7 +192,7 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t

### LR Queue Withdrawal

![](/tests/snapshots/nanox_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00005.png)
![](/tests/snapshots/nanox_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00005.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00006.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00007.png)

### LR Complete Queued Withdrawal

Expand Down
2 changes: 1 addition & 1 deletion src/handle_finalize.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void handle_finalize(ethPluginFinalize_t *msg) {
msg->result = ETH_PLUGIN_RESULT_OK;
break;
case KILN_LR_DEPOSIT_INTO_STRATEGY:
msg->numScreens = 2;
msg->numScreens = 3;
msg->result = ETH_PLUGIN_RESULT_OK;
break;
case KILN_LR_QUEUE_WITHDRAWAL:
Expand Down
13 changes: 4 additions & 9 deletions src/handle_provide_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ bool compare_addresses(const char *a, const char *b) {
* otherwise set it to unkwown (-1)
*
* @param address: address to compare
* @param index: index of the erc20 in the context
* @param context: context to update
*
* @returns index of the erc20 in the context or -1 if not found
*/
int find_lr_known_erc20(const char *address, context_t *context) {
int find_lr_known_erc20(const char *address) {
for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) {
if (compare_addresses(address, lr_erc20_addresses[i])) {
return i;
Expand All @@ -43,12 +41,10 @@ int find_lr_known_erc20(const char *address, context_t *context) {
* otherwise set it to unkwown (-1)
*
* @param address: address to compare
* @param index: index of the strategy in the context
* @param context: context to update
*
* @returns index of the strategy in the context or -1 if not found
*/
int find_lr_known_strategy(const char *address, context_t *context) {
int find_lr_known_strategy(const char *address) {
for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) {
if (compare_addresses(address, lr_strategy_addresses[i])) {
return i;
Expand Down Expand Up @@ -79,7 +75,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t
msg->pluginSharedRW->sha3,
0);
context->param_data.lr_deposit.strategy_to_display =
find_lr_known_strategy(address_buffer, context);
find_lr_known_strategy(address_buffer);

context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN;
break;
Expand All @@ -90,8 +86,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t
sizeof(address_buffer),
msg->pluginSharedRW->sha3,
0);
context->param_data.lr_deposit.erc20_to_display =
find_lr_known_erc20(address_buffer, context);
context->param_data.lr_deposit.erc20_to_display = find_lr_known_erc20(address_buffer);

context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/handle_query_contract_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void handle_query_contract_id(ethQueryContractID_t *msg) {
break;

case KILN_LR_DEPOSIT_INTO_STRATEGY:
strlcpy(msg->version, "Deposit In Strategy", msg->versionLength);
strlcpy(msg->version, "Liquid Restaking", msg->versionLength);
break;

case KILN_LR_QUEUE_WITHDRAWAL:
Expand Down
7 changes: 6 additions & 1 deletion src/handle_query_contract_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con

switch (msg->screenIndex) {
case 0:
strlcpy(msg->title, "EigenLayer", msg->titleLength);
strlcpy(msg->msg, "Deposit In Strategy", msg->msgLength);
ret = true;
break;
case 1:
strlcpy(msg->title, "Strategy", msg->titleLength);
if (params->strategy_to_display == -1) {
strlcpy(msg->msg, "UNKNOWN", msg->msgLength);
Expand All @@ -187,7 +192,7 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con
}
ret = true;
break;
case 1:
case 2:
strlcpy(msg->title, "Amount", msg->titleLength);
amountToString(
params->erc20_amount_to_display,
Expand Down
3 changes: 0 additions & 3 deletions src/kiln_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ typedef struct {
} lr_queue_withdrawal_t;

typedef struct {
// int lr_strategy_to_display[MAX_DISPLAY_COUNT];
// int lr_erc20_to_display[MAX_DISPLAY_COUNT];
// uint8_t lr_erc20_amount_to_display[MAX_DISPLAY_COUNT][INT256_LENGTH];
} lr_complete_queued_withdrawal_t;

typedef struct context_t {
Expand Down
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyNormal/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyNormal/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyNormal/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyNormal/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyNormal/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyNormal/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyNormal/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyNormal/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyNormal/00005.png
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyNormal/00006.png
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00002.png
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00004.png
Binary file modified tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00006.png
2 changes: 1 addition & 1 deletion tests/src/lrDepositIntoStrategy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; // strategy m
const pluginName = 'Kiln';
const abi_path = `../cal/abis/${contractAddr}.json`;
const abi = require(abi_path);
const right_clicks = 5;
const right_clicks = 6;

nano_models.forEach(function (model) {
test(
Expand Down
2 changes: 1 addition & 1 deletion tests/src/lrQueueWithdrawal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ nano_models.forEach(function (model) {
}
);
const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution);
const right_clicks = 4;
const right_clicks = 7;

await waitForAppScreen(sim);
await sim.navigateAndCompareSnapshots(
Expand Down

0 comments on commit 3b12388

Please sign in to comment.