diff --git a/Makefile b/Makefile index 19b87c4..2c1a561 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ APPNAME = "StakeKit" # Application version APPVERSION_M = 1 -APPVERSION_N = 2 -APPVERSION_P = 2 +APPVERSION_N = 3 +APPVERSION_P = 0 include ethereum-plugin-sdk/standard_plugin.mk diff --git a/src/contract.c b/src/contract.c index 30b712b..3c8bdf7 100644 --- a/src/contract.c +++ b/src/contract.c @@ -104,7 +104,8 @@ static const uint8_t STAKEKIT_VIC_RESIGN_SELECTOR[SELECTOR_SIZE] = {0xae, 0x6e, static const uint8_t STAKEKIT_VIC_UNVOTE_SELECTOR[SELECTOR_SIZE] = {0x02, 0xaa, 0x9b, 0xe2}; static const uint8_t STAKEKIT_VIC_WITHDRAW_SELECTOR[SELECTOR_SIZE] = {0x44, 0x1a, 0x3e, 0x70}; static const uint8_t STAKEKIT_CLAIM_SELECTOR[SELECTOR_SIZE] = {0xaa, 0xd3, 0xec, 0x96}; - +static const uint8_t STAKEKIT_DELEGATE_SELECTOR[SELECTOR_SIZE] = {0x98, 0x2e, 0xf0, 0xa7}; +static const uint8_t STAKEKIT_REDELEGATE_SELECTOR[SELECTOR_SIZE] = {0x59, 0x49, 0x18, 0x71}; // Array of all the different StakeKit selectors. const uint8_t *const STAKEKIT_SELECTORS[NUM_STAKEKIT_SELECTORS] = { STAKEKIT_DEPOSIT_SELF_APECOIN_SELECTOR, @@ -162,7 +163,9 @@ const uint8_t *const STAKEKIT_SELECTORS[NUM_STAKEKIT_SELECTORS] = { STAKEKIT_VIC_RESIGN_SELECTOR, STAKEKIT_VIC_UNVOTE_SELECTOR, STAKEKIT_VIC_WITHDRAW_SELECTOR, - STAKEKIT_CLAIM_SELECTOR}; + STAKEKIT_CLAIM_SELECTOR, + STAKEKIT_DELEGATE_SELECTOR, + STAKEKIT_REDELEGATE_SELECTOR}; // Null address const uint8_t NULL_ETH_ADDRESS[ADDRESS_LENGTH] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/handle_finalize.c b/src/handle_finalize.c index 0c0abc6..d138130 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -66,9 +66,14 @@ void handle_finalize(ethPluginFinalize_t *msg) { switch (context->selectorIndex) { case COMET_CLAIM: case CLAIM: + case DELEGATE: msg->numScreens = 2; msg->result = ETH_PLUGIN_RESULT_OK; break; + case REDELEGATE: + msg->numScreens = 3; + msg->result = ETH_PLUGIN_RESULT_OK; + break; case VOTE: msg->numScreens = 4; msg->result = ETH_PLUGIN_RESULT_OK; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 7a96a29..445e81e 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -81,6 +81,8 @@ void handle_init_contract(ethPluginInitContract_t *msg) { case REVOKE_ACTIVE: case VIC_UNVOTE: case CLAIM: + case DELEGATE: + case REDELEGATE: context->next_param = RECIPIENT; break; case MORPHO_SUPPLY_1: diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index a19679d..3b9a344 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -223,8 +223,9 @@ static void handle_comet_claim(ethPluginProvideParameter_t *msg, plugin_paramete // Save 1 amount and 1 recipient in the context. // The first param is the operator saved in recipient. -// The second param is the request number saved in amount_sent. -static void handle_claim(ethPluginProvideParameter_t *msg, plugin_parameters_t *context) { +// The second param is the [request number | vote power | shares] saved in amount_sent. +static void handle_claim_and_delegate(ethPluginProvideParameter_t *msg, + plugin_parameters_t *context) { switch (context->next_param) { case RECIPIENT: // Put the operator address in recipient copy_address(context->recipient, msg->parameter, ADDRESS_LENGTH); @@ -243,6 +244,34 @@ static void handle_claim(ethPluginProvideParameter_t *msg, plugin_parameters_t * } } +// Save 2 operator and 1 amount in the context. +// The first param is the old operator address saved in recipient. +// The second param is the new operator address saved in contract_address. +// The third param is the delegateVotePower saved in amount_received. +static void handle_redelegate(ethPluginProvideParameter_t *msg, plugin_parameters_t *context) { + switch (context->next_param) { + case RECIPIENT: // Put the old operator address in recipient + copy_address(context->recipient, msg->parameter, ADDRESS_LENGTH); + context->next_param = RECIPIENT_2; + break; + case RECIPIENT_2: // Put the new operator address in contract_address + copy_address(context->contract_address, msg->parameter, ADDRESS_LENGTH); + context->next_param = AMOUNT_SENT; + context->skip = 1; + break; + case AMOUNT_SENT: // Skip shares and put the delegateVotePower in amount_sent + copy_parameter(context->amount_sent, msg->parameter, INT256_LENGTH); + context->next_param = AMOUNT_RECEIVED; + break; + case NONE: + break; + default: + PRINTF("Param not supported\n"); + msg->result = ETH_PLUGIN_RESULT_ERROR; + break; + } +} + // Save 1 amount and 3 recipients in the context. // The first param is the second recipient saved in recipient. // The second param is the amount sent saved in amount_sent. @@ -559,7 +588,11 @@ void handle_provide_parameter(ethPluginProvideParameter_t *msg) { handle_lido_claim_withdrawal(msg, context); break; case CLAIM: - handle_claim(msg, context); + case DELEGATE: + handle_claim_and_delegate(msg, context); + break; + case REDELEGATE: + handle_redelegate(msg, context); break; case VIC_VOTE: case VIC_RESIGN: diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index e7cba3c..e982649 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -66,11 +66,15 @@ void handle_query_contract_id(ethQueryContractID_t *msg) { strlcpy(msg->version, "Deposit", msg->versionLength); break; case GRT_DELEGATE: + case DELEGATE: strlcpy(msg->version, "Delegate", msg->versionLength); break; case GRT_UNDELEGATE: strlcpy(msg->version, "Undelegate", msg->versionLength); break; + case REDELEGATE: + strlcpy(msg->version, "Redelegate", msg->versionLength); + break; case GRT_WITHDRAW_DELEGATED: strlcpy(msg->version, "Withdraw Delegated", msg->versionLength); break; diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index e6551a9..ff5c6d7 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -65,6 +65,9 @@ static bool set_send_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) case CLAIM: strlcpy(msg->title, "Request Number", msg->titleLength); break; + case DELEGATE: + strlcpy(msg->title, "Vote Power", msg->titleLength); + break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); return false; @@ -261,8 +264,12 @@ static bool set_recipient_ui(ethQueryContractUI_t *msg, plugin_parameters_t *con strlcpy(msg->title, "Candidate", msg->titleLength); break; case CLAIM: + case DELEGATE: strlcpy(msg->title, "Operator", msg->titleLength); break; + case REDELEGATE: + strlcpy(msg->title, "Old Operator", msg->titleLength); + break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); return false; @@ -286,6 +293,9 @@ static bool set_recipient_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *c case ANGLE_WITHDRAW: strlcpy(msg->title, "Owner", msg->titleLength); break; + case REDELEGATE: + strlcpy(msg->title, "New Operator", msg->titleLength); + break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); return false; @@ -370,6 +380,18 @@ static bool set_warning_ui(ethQueryContractUI_t *msg, return true; } +// Set UI for "Vote Power" screen. +static bool set_delegate_vote_power_ui(ethQueryContractUI_t *msg, + plugin_parameters_t *context __attribute__((unused))) { + strlcpy(msg->title, "Vote Power", msg->titleLength); + if (ADDRESS_IS_NULL(context->amount_sent)) { + strlcpy(msg->msg, "False", msg->msgLength); + } else { + strlcpy(msg->msg, "True", msg->msgLength); + } + return true; +} + // Set UI for the methods needing a send screen. static screens_t get_screen_amount_sent(ethQueryContractUI_t *msg, plugin_parameters_t *context __attribute__((unused))) { @@ -406,6 +428,34 @@ static screens_t get_screen_amount_sent_recipient(ethQueryContractUI_t *msg, } } +// Set UI for the methods needing a send and vote power screens. +static screens_t get_screen_delegate(ethQueryContractUI_t *msg, + plugin_parameters_t *context __attribute__((unused))) { + switch (msg->screenIndex) { + case 0: + return DELEGATE_VOTE_POWER_SCREEN; + case 1: + return RECIPIENT_SCREEN; + default: + return ERROR; + } +} + +// Set UI for the methods needing a send and vote power screens. +static screens_t get_screen_redelegate(ethQueryContractUI_t *msg, + plugin_parameters_t *context __attribute__((unused))) { + switch (msg->screenIndex) { + case 0: + return DELEGATE_VOTE_POWER_SCREEN; + case 1: + return RECIPIENT_SCREEN; + case 2: + return RECIPIENT_2_SCREEN; + default: + return ERROR; + } +} + // Set UI for the methods needing a send and recipient screens. // If the token is not found, we need an additional screen to display a warning message. static screens_t get_screen_supply(ethQueryContractUI_t *msg, @@ -628,6 +678,10 @@ static screens_t get_screen(ethQueryContractUI_t *msg, case VIC_UNVOTE: case CLAIM: return get_screen_amount_sent_recipient(msg, context); + case DELEGATE: + return get_screen_delegate(msg, context); + case REDELEGATE: + return get_screen_redelegate(msg, context); case MORPHO_SUPPLY_1: case MORPHO_SUPPLY_2: case MORPHO_SUPPLY_3: @@ -709,6 +763,9 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { case RECEIVE_2_SCREEN: ret = set_receive_2_ui(msg, context); break; + case DELEGATE_VOTE_POWER_SCREEN: + ret = set_delegate_vote_power_ui(msg, context); + break; case WARN_SCREEN: ret = set_warning_ui(msg, context); break; diff --git a/src/stakekit_plugin.h b/src/stakekit_plugin.h index 245d17e..7cf44e3 100644 --- a/src/stakekit_plugin.h +++ b/src/stakekit_plugin.h @@ -7,7 +7,7 @@ #define PLUGIN_NAME "StakeKit" -#define NUM_STAKEKIT_SELECTORS 56u +#define NUM_STAKEKIT_SELECTORS 58u #define TICKER_LEN 30u @@ -92,6 +92,8 @@ typedef enum { VIC_UNVOTE, VIC_WITHDRAW, CLAIM, + DELEGATE, + REDELEGATE, } selector_t; extern const uint8_t *const STAKEKIT_SELECTORS[NUM_STAKEKIT_SELECTORS]; @@ -108,6 +110,7 @@ typedef enum { WARN_SCREEN, SEND_2_SCREEN, RECEIVE_2_SCREEN, + DELEGATE_VOTE_POWER_SCREEN, ERROR, } screens_t; diff --git a/tests/snapshots/bsc_flex_bsc_delegate/00000.png b/tests/snapshots/bsc_flex_bsc_delegate/00000.png new file mode 100644 index 0000000..e0da6f2 Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_delegate/00000.png differ diff --git a/tests/snapshots/bsc_flex_bsc_delegate/00001.png b/tests/snapshots/bsc_flex_bsc_delegate/00001.png new file mode 100644 index 0000000..4f1d3b0 Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_delegate/00001.png differ diff --git a/tests/snapshots/bsc_flex_bsc_delegate/00002.png b/tests/snapshots/bsc_flex_bsc_delegate/00002.png new file mode 100644 index 0000000..e44a9b7 Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_delegate/00002.png differ diff --git a/tests/snapshots/bsc_flex_bsc_delegate/00003.png b/tests/snapshots/bsc_flex_bsc_delegate/00003.png new file mode 100644 index 0000000..4541c50 Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_delegate/00003.png differ diff --git a/tests/snapshots/bsc_flex_bsc_delegate/00004.png b/tests/snapshots/bsc_flex_bsc_delegate/00004.png new file mode 100644 index 0000000..dabe7af Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_delegate/00004.png differ diff --git a/tests/snapshots/bsc_flex_bsc_redelegate/00000.png b/tests/snapshots/bsc_flex_bsc_redelegate/00000.png new file mode 100644 index 0000000..6a4c07b Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_redelegate/00000.png differ diff --git a/tests/snapshots/bsc_flex_bsc_redelegate/00001.png b/tests/snapshots/bsc_flex_bsc_redelegate/00001.png new file mode 100644 index 0000000..da2bd2b Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_redelegate/00001.png differ diff --git a/tests/snapshots/bsc_flex_bsc_redelegate/00002.png b/tests/snapshots/bsc_flex_bsc_redelegate/00002.png new file mode 100644 index 0000000..5588931 Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_redelegate/00002.png differ diff --git a/tests/snapshots/bsc_flex_bsc_redelegate/00003.png b/tests/snapshots/bsc_flex_bsc_redelegate/00003.png new file mode 100644 index 0000000..94f42c0 Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_redelegate/00003.png differ diff --git a/tests/snapshots/bsc_flex_bsc_redelegate/00004.png b/tests/snapshots/bsc_flex_bsc_redelegate/00004.png new file mode 100644 index 0000000..dabe7af Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_redelegate/00004.png differ diff --git a/tests/snapshots/bsc_flex_bsc_undelegate/00000.png b/tests/snapshots/bsc_flex_bsc_undelegate/00000.png new file mode 100644 index 0000000..32c5bfe Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_undelegate/00000.png differ diff --git a/tests/snapshots/bsc_flex_bsc_undelegate/00001.png b/tests/snapshots/bsc_flex_bsc_undelegate/00001.png new file mode 100644 index 0000000..204b1ad Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_undelegate/00001.png differ diff --git a/tests/snapshots/bsc_flex_bsc_undelegate/00002.png b/tests/snapshots/bsc_flex_bsc_undelegate/00002.png new file mode 100644 index 0000000..dae469c Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_undelegate/00002.png differ diff --git a/tests/snapshots/bsc_flex_bsc_undelegate/00003.png b/tests/snapshots/bsc_flex_bsc_undelegate/00003.png new file mode 100644 index 0000000..dabe7af Binary files /dev/null and b/tests/snapshots/bsc_flex_bsc_undelegate/00003.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00000.png b/tests/snapshots/bsc_nanos_bsc_delegate/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00000.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00001.png b/tests/snapshots/bsc_nanos_bsc_delegate/00001.png new file mode 100644 index 0000000..f44b8c3 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00001.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00002.png b/tests/snapshots/bsc_nanos_bsc_delegate/00002.png new file mode 100644 index 0000000..fa6d68a Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00002.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00003.png b/tests/snapshots/bsc_nanos_bsc_delegate/00003.png new file mode 100644 index 0000000..2fac5ed Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00003.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00004.png b/tests/snapshots/bsc_nanos_bsc_delegate/00004.png new file mode 100644 index 0000000..c2dab1c Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00004.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00005.png b/tests/snapshots/bsc_nanos_bsc_delegate/00005.png new file mode 100644 index 0000000..82cc009 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00005.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00006.png b/tests/snapshots/bsc_nanos_bsc_delegate/00006.png new file mode 100644 index 0000000..371c126 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00006.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00007.png b/tests/snapshots/bsc_nanos_bsc_delegate/00007.png new file mode 100644 index 0000000..bbe5c0a Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00007.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00008.png b/tests/snapshots/bsc_nanos_bsc_delegate/00008.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00008.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_delegate/00009.png b/tests/snapshots/bsc_nanos_bsc_delegate/00009.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_delegate/00009.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00000.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00000.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00001.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00001.png new file mode 100644 index 0000000..d131d03 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00001.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00002.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00002.png new file mode 100644 index 0000000..fa6d68a Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00002.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00003.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00003.png new file mode 100644 index 0000000..b3b4eb7 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00003.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00004.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00004.png new file mode 100644 index 0000000..0c77729 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00004.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00005.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00005.png new file mode 100644 index 0000000..b32dc80 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00005.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00006.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00006.png new file mode 100644 index 0000000..314f967 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00006.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00007.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00007.png new file mode 100644 index 0000000..d3b85d4 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00007.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00008.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00008.png new file mode 100644 index 0000000..7cf898d Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00008.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00009.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00009.png new file mode 100644 index 0000000..371c126 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00009.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00010.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00010.png new file mode 100644 index 0000000..bbe5c0a Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00010.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00011.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00011.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00011.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_redelegate/00012.png b/tests/snapshots/bsc_nanos_bsc_redelegate/00012.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_redelegate/00012.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00000.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00000.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00001.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00001.png new file mode 100644 index 0000000..e5afb0b Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00001.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00002.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00002.png new file mode 100644 index 0000000..f352306 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00002.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00003.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00003.png new file mode 100644 index 0000000..4733066 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00003.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00004.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00004.png new file mode 100644 index 0000000..e71f520 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00004.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00005.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00005.png new file mode 100644 index 0000000..371c126 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00005.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00006.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00006.png new file mode 100644 index 0000000..bbe5c0a Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00006.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00007.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00007.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00007.png differ diff --git a/tests/snapshots/bsc_nanos_bsc_undelegate/00008.png b/tests/snapshots/bsc_nanos_bsc_undelegate/00008.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/snapshots/bsc_nanos_bsc_undelegate/00008.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_delegate/00000.png b/tests/snapshots/bsc_nanosp_bsc_delegate/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_delegate/00000.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_delegate/00001.png b/tests/snapshots/bsc_nanosp_bsc_delegate/00001.png new file mode 100644 index 0000000..07c6b1e Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_delegate/00001.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_delegate/00002.png b/tests/snapshots/bsc_nanosp_bsc_delegate/00002.png new file mode 100644 index 0000000..f1411f6 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_delegate/00002.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_delegate/00003.png b/tests/snapshots/bsc_nanosp_bsc_delegate/00003.png new file mode 100644 index 0000000..2b4940c Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_delegate/00003.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_delegate/00004.png b/tests/snapshots/bsc_nanosp_bsc_delegate/00004.png new file mode 100644 index 0000000..0d6794d Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_delegate/00004.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_delegate/00005.png b/tests/snapshots/bsc_nanosp_bsc_delegate/00005.png new file mode 100644 index 0000000..3af6333 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_delegate/00005.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_delegate/00006.png b/tests/snapshots/bsc_nanosp_bsc_delegate/00006.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_delegate/00006.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_delegate/00007.png b/tests/snapshots/bsc_nanosp_bsc_delegate/00007.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_delegate/00007.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00000.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00000.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00001.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00001.png new file mode 100644 index 0000000..160e2bf Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00001.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00002.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00002.png new file mode 100644 index 0000000..f1411f6 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00002.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00003.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00003.png new file mode 100644 index 0000000..e51fba5 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00003.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00004.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00004.png new file mode 100644 index 0000000..0627905 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00004.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00005.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00005.png new file mode 100644 index 0000000..0d6794d Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00005.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00006.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00006.png new file mode 100644 index 0000000..3af6333 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00006.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00007.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00007.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00007.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_redelegate/00008.png b/tests/snapshots/bsc_nanosp_bsc_redelegate/00008.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_redelegate/00008.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_undelegate/00000.png b/tests/snapshots/bsc_nanosp_bsc_undelegate/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_undelegate/00000.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_undelegate/00001.png b/tests/snapshots/bsc_nanosp_bsc_undelegate/00001.png new file mode 100644 index 0000000..aee1582 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_undelegate/00001.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_undelegate/00002.png b/tests/snapshots/bsc_nanosp_bsc_undelegate/00002.png new file mode 100644 index 0000000..538a3cc Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_undelegate/00002.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_undelegate/00003.png b/tests/snapshots/bsc_nanosp_bsc_undelegate/00003.png new file mode 100644 index 0000000..0d6794d Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_undelegate/00003.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_undelegate/00004.png b/tests/snapshots/bsc_nanosp_bsc_undelegate/00004.png new file mode 100644 index 0000000..3af6333 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_undelegate/00004.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_undelegate/00005.png b/tests/snapshots/bsc_nanosp_bsc_undelegate/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_undelegate/00005.png differ diff --git a/tests/snapshots/bsc_nanosp_bsc_undelegate/00006.png b/tests/snapshots/bsc_nanosp_bsc_undelegate/00006.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/bsc_nanosp_bsc_undelegate/00006.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_delegate/00000.png b/tests/snapshots/bsc_nanox_bsc_delegate/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_delegate/00000.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_delegate/00001.png b/tests/snapshots/bsc_nanox_bsc_delegate/00001.png new file mode 100644 index 0000000..07c6b1e Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_delegate/00001.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_delegate/00002.png b/tests/snapshots/bsc_nanox_bsc_delegate/00002.png new file mode 100644 index 0000000..f1411f6 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_delegate/00002.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_delegate/00003.png b/tests/snapshots/bsc_nanox_bsc_delegate/00003.png new file mode 100644 index 0000000..2b4940c Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_delegate/00003.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_delegate/00004.png b/tests/snapshots/bsc_nanox_bsc_delegate/00004.png new file mode 100644 index 0000000..0d6794d Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_delegate/00004.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_delegate/00005.png b/tests/snapshots/bsc_nanox_bsc_delegate/00005.png new file mode 100644 index 0000000..3af6333 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_delegate/00005.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_delegate/00006.png b/tests/snapshots/bsc_nanox_bsc_delegate/00006.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_delegate/00006.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_delegate/00007.png b/tests/snapshots/bsc_nanox_bsc_delegate/00007.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_delegate/00007.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00000.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00000.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00001.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00001.png new file mode 100644 index 0000000..160e2bf Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00001.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00002.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00002.png new file mode 100644 index 0000000..f1411f6 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00002.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00003.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00003.png new file mode 100644 index 0000000..e51fba5 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00003.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00004.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00004.png new file mode 100644 index 0000000..0627905 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00004.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00005.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00005.png new file mode 100644 index 0000000..0d6794d Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00005.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00006.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00006.png new file mode 100644 index 0000000..3af6333 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00006.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00007.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00007.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00007.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_redelegate/00008.png b/tests/snapshots/bsc_nanox_bsc_redelegate/00008.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_redelegate/00008.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_undelegate/00000.png b/tests/snapshots/bsc_nanox_bsc_undelegate/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_undelegate/00000.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_undelegate/00001.png b/tests/snapshots/bsc_nanox_bsc_undelegate/00001.png new file mode 100644 index 0000000..aee1582 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_undelegate/00001.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_undelegate/00002.png b/tests/snapshots/bsc_nanox_bsc_undelegate/00002.png new file mode 100644 index 0000000..538a3cc Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_undelegate/00002.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_undelegate/00003.png b/tests/snapshots/bsc_nanox_bsc_undelegate/00003.png new file mode 100644 index 0000000..0d6794d Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_undelegate/00003.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_undelegate/00004.png b/tests/snapshots/bsc_nanox_bsc_undelegate/00004.png new file mode 100644 index 0000000..3af6333 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_undelegate/00004.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_undelegate/00005.png b/tests/snapshots/bsc_nanox_bsc_undelegate/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_undelegate/00005.png differ diff --git a/tests/snapshots/bsc_nanox_bsc_undelegate/00006.png b/tests/snapshots/bsc_nanox_bsc_undelegate/00006.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/bsc_nanox_bsc_undelegate/00006.png differ diff --git a/tests/snapshots/bsc_stax_bsc_delegate/00000.png b/tests/snapshots/bsc_stax_bsc_delegate/00000.png new file mode 100644 index 0000000..857e8a7 Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_delegate/00000.png differ diff --git a/tests/snapshots/bsc_stax_bsc_delegate/00001.png b/tests/snapshots/bsc_stax_bsc_delegate/00001.png new file mode 100644 index 0000000..1337454 Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_delegate/00001.png differ diff --git a/tests/snapshots/bsc_stax_bsc_delegate/00002.png b/tests/snapshots/bsc_stax_bsc_delegate/00002.png new file mode 100644 index 0000000..d96d31c Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_delegate/00002.png differ diff --git a/tests/snapshots/bsc_stax_bsc_delegate/00003.png b/tests/snapshots/bsc_stax_bsc_delegate/00003.png new file mode 100644 index 0000000..339db1b Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_delegate/00003.png differ diff --git a/tests/snapshots/bsc_stax_bsc_redelegate/00000.png b/tests/snapshots/bsc_stax_bsc_redelegate/00000.png new file mode 100644 index 0000000..1889a59 Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_redelegate/00000.png differ diff --git a/tests/snapshots/bsc_stax_bsc_redelegate/00001.png b/tests/snapshots/bsc_stax_bsc_redelegate/00001.png new file mode 100644 index 0000000..79fc389 Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_redelegate/00001.png differ diff --git a/tests/snapshots/bsc_stax_bsc_redelegate/00002.png b/tests/snapshots/bsc_stax_bsc_redelegate/00002.png new file mode 100644 index 0000000..1a676c4 Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_redelegate/00002.png differ diff --git a/tests/snapshots/bsc_stax_bsc_redelegate/00003.png b/tests/snapshots/bsc_stax_bsc_redelegate/00003.png new file mode 100644 index 0000000..19a8239 Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_redelegate/00003.png differ diff --git a/tests/snapshots/bsc_stax_bsc_redelegate/00004.png b/tests/snapshots/bsc_stax_bsc_redelegate/00004.png new file mode 100644 index 0000000..339db1b Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_redelegate/00004.png differ diff --git a/tests/snapshots/bsc_stax_bsc_undelegate/00000.png b/tests/snapshots/bsc_stax_bsc_undelegate/00000.png new file mode 100644 index 0000000..ddc85dc Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_undelegate/00000.png differ diff --git a/tests/snapshots/bsc_stax_bsc_undelegate/00001.png b/tests/snapshots/bsc_stax_bsc_undelegate/00001.png new file mode 100644 index 0000000..811a450 Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_undelegate/00001.png differ diff --git a/tests/snapshots/bsc_stax_bsc_undelegate/00002.png b/tests/snapshots/bsc_stax_bsc_undelegate/00002.png new file mode 100644 index 0000000..7a353ae Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_undelegate/00002.png differ diff --git a/tests/snapshots/bsc_stax_bsc_undelegate/00003.png b/tests/snapshots/bsc_stax_bsc_undelegate/00003.png new file mode 100644 index 0000000..339db1b Binary files /dev/null and b/tests/snapshots/bsc_stax_bsc_undelegate/00003.png differ diff --git a/tests/src/bsc/bsc_delegate.test.js b/tests/src/bsc/bsc_delegate.test.js new file mode 100644 index 0000000..2df783f --- /dev/null +++ b/tests/src/bsc/bsc_delegate.test.js @@ -0,0 +1,47 @@ +import { processTest, populateTransaction } from "../test.fixture"; + +const contractName = "StakeHub"; // <= Name of the smart contract + +const testLabel = "bsc_delegate"; // <= Name of the test +const testDirSuffix = "bsc_delegate"; // <= directory to compare device snapshots to +const testNetwork = "bsc"; +const signedPlugin = false; + +const contractAddr = "0x0000000000000000000000000000000000002002"; // <= Address of the smart contract +const chainID = 56; + +// From : https://bscscan.com/tx/0x16a08e90b09c97842f2656d1b2bb0f3f65c9d8cbcd1e318d45a89cceaa7c397b +const inputData = "0x982ef0a700000000000000000000000031738238b6a4fcb00ba4de9ee923986b6df55ae60000000000000000000000000000000000000000000000000000000000000000"; + +// Create serializedTx and remove the "0x" prefix +const serializedTx = populateTransaction(contractAddr, inputData, chainID); + +const devices = [ + { + name: "nanos", + label: "Nano S", + steps: 8, // <= Define the number of steps for this test case and this device + }, + { + name: "nanox", + label: "Nano X", + steps: 6, // <= Define the number of steps for this test case and this device + }, + { + name: "nanosp", + label: "Nano S+", + steps: 6, // <= Define the number of steps for this test case and this device + }, + { + name: "stax", + label: "Stax", + }, + { + name: "flex", + label: "Flex", + } +]; + +devices.forEach((device) => + processTest(device, contractName, testLabel, testDirSuffix, "", signedPlugin, serializedTx, testNetwork) +); diff --git a/tests/src/bsc/bsc_redelegate.test.js b/tests/src/bsc/bsc_redelegate.test.js new file mode 100644 index 0000000..ea3420c --- /dev/null +++ b/tests/src/bsc/bsc_redelegate.test.js @@ -0,0 +1,47 @@ +import { processTest, populateTransaction } from "../test.fixture"; + +const contractName = "StakeHub"; // <= Name of the smart contract + +const testLabel = "bsc_redelegate"; // <= Name of the test +const testDirSuffix = "bsc_redelegate"; // <= directory to compare device snapshots to +const testNetwork = "bsc"; +const signedPlugin = false; + +const contractAddr = "0x0000000000000000000000000000000000002002"; // <= Address of the smart contract +const chainID = 56; + +// From : https://bscscan.com/tx/0x7e69d623b177ef2b1dc7e4342e05e68104ff63a0cfccc44b4badefcfc07a2b63 +const inputData = "0x594918710000000000000000000000009941bce2601fc93478df9f5f6cc83f4ffc1d71d800000000000000000000000031738238b6a4fcb00ba4de9ee923986b6df55ae6000000000000000000000000000000000000000000000000468aa1967d98533d0000000000000000000000000000000000000000000000000000000000000000"; + +// Create serializedTx and remove the "0x" prefix +const serializedTx = populateTransaction(contractAddr, inputData, chainID); + +const devices = [ + { + name: "nanos", + label: "Nano S", + steps: 11, // <= Define the number of steps for this test case and this device + }, + { + name: "nanox", + label: "Nano X", + steps: 7, // <= Define the number of steps for this test case and this device + }, + { + name: "nanosp", + label: "Nano S+", + steps: 7, // <= Define the number of steps for this test case and this device + }, + { + name: "stax", + label: "Stax", + }, + { + name: "flex", + label: "Flex", + } +]; + +devices.forEach((device) => + processTest(device, contractName, testLabel, testDirSuffix, "", signedPlugin, serializedTx, testNetwork) +); diff --git a/tests/src/bsc/bsc_undelegate.test.js b/tests/src/bsc/bsc_undelegate.test.js new file mode 100644 index 0000000..5cb58f2 --- /dev/null +++ b/tests/src/bsc/bsc_undelegate.test.js @@ -0,0 +1,47 @@ +import { processTest, populateTransaction } from "../test.fixture"; + +const contractName = "StakeHub"; // <= Name of the smart contract + +const testLabel = "bsc_undelegate"; // <= Name of the test +const testDirSuffix = "bsc_undelegate"; // <= directory to compare device snapshots to +const testNetwork = "bsc"; +const signedPlugin = false; + +const contractAddr = "0x0000000000000000000000000000000000002002"; // <= Address of the smart contract +const chainID = 56; + +// From : https://bscscan.com/tx/0x53db4ffefe847eab3683dd9201be2a6e410ab507b43051ac08fe9b61ef337c12 +const inputData = "0x4d99dd1600000000000000000000000011f3a9d13f6f11f29a7c96922c5471f356bd129f0000000000000000000000000000000000000000000000000dc0b539ef122ad6"; + +// Create serializedTx and remove the "0x" prefix +const serializedTx = populateTransaction(contractAddr, inputData, chainID); + +const devices = [ + { + name: "nanos", + label: "Nano S", + steps: 7, // <= Define the number of steps for this test case and this device + }, + { + name: "nanox", + label: "Nano X", + steps: 5, // <= Define the number of steps for this test case and this device + }, + { + name: "nanosp", + label: "Nano S+", + steps: 5, // <= Define the number of steps for this test case and this device + }, + { + name: "stax", + label: "Stax", + }, + { + name: "flex", + label: "Flex", + } +]; + +devices.forEach((device) => + processTest(device, contractName, testLabel, testDirSuffix, "", signedPlugin, serializedTx, testNetwork) +);