forked from stader-labs/app-plugin-staderlabs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Manoj Patra
committed
Oct 19, 2023
1 parent
ce56599
commit f090f96
Showing
60 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+374 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/00000.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 added
BIN
+362 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/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 added
BIN
+396 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/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 added
BIN
+494 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/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 added
BIN
+473 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/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 added
BIN
+366 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/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 added
BIN
+366 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/00006.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 added
BIN
+480 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/00007.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 added
BIN
+349 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/00008.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 added
BIN
+414 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/00009.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 added
BIN
+349 Bytes
tests/snapshots/ethereum_ethx_nanos_legacy_request_withdraw_eth/00010.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.
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 added
BIN
+414 Bytes
tests/snapshots/ethereum_ethx_nanosp_legacy_request_withdraw_eth/00000.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 added
BIN
+434 Bytes
tests/snapshots/ethereum_ethx_nanosp_legacy_request_withdraw_eth/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 added
BIN
+450 Bytes
tests/snapshots/ethereum_ethx_nanosp_legacy_request_withdraw_eth/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 added
BIN
+789 Bytes
tests/snapshots/ethereum_ethx_nanosp_legacy_request_withdraw_eth/00003.png
Oops, something went wrong.
Binary file added
BIN
+599 Bytes
tests/snapshots/ethereum_ethx_nanosp_legacy_request_withdraw_eth/00004.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
tests/snapshots/ethereum_ethx_nanosp_legacy_request_withdraw_eth/00005.png
Oops, something went wrong.
Binary file added
BIN
+382 Bytes
tests/snapshots/ethereum_ethx_nanosp_legacy_request_withdraw_eth/00006.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+414 Bytes
tests/snapshots/ethereum_ethx_nanox_legacy_request_withdraw_eth/00000.png
Oops, something went wrong.
Binary file added
BIN
+430 Bytes
tests/snapshots/ethereum_ethx_nanox_legacy_request_withdraw_eth/00001.png
Oops, something went wrong.
Binary file added
BIN
+453 Bytes
tests/snapshots/ethereum_ethx_nanox_legacy_request_withdraw_eth/00002.png
Oops, something went wrong.
Binary file added
BIN
+789 Bytes
tests/snapshots/ethereum_ethx_nanox_legacy_request_withdraw_eth/00003.png
Oops, something went wrong.
Binary file added
BIN
+597 Bytes
tests/snapshots/ethereum_ethx_nanox_legacy_request_withdraw_eth/00004.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
tests/snapshots/ethereum_ethx_nanox_legacy_request_withdraw_eth/00005.png
Oops, something went wrong.
Binary file added
BIN
+381 Bytes
tests/snapshots/ethereum_ethx_nanox_legacy_request_withdraw_eth/00006.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import "core-js/stable"; | ||
import "regenerator-runtime"; | ||
import { | ||
waitForAppScreen, | ||
zemu, | ||
nano_models, | ||
serializeTx, | ||
txFromEtherscan, | ||
} from "../../test.fixture"; | ||
|
||
const contractAddr = "0xcf5ea1b38380f6af39068375516daf40ed70d299"; | ||
const pluginName = "staderlabs"; | ||
const testNetwork = "ethereum"; | ||
const chainID = 1; | ||
// Test from replayed transaction: https://etherscan.io/tx/0x4e771017864ff34176c8c9fa62fe1950852933345f921dc5316c63554c9bc453 | ||
const inputData = | ||
"0x02f8980113850550de54dd850550de54dd8301c88a94cf5ea1b38380f6af39068375516daf40ed70d29987038d7ea4c68000a4f340fa01000000000000000000000000ad345b348bd84a4b42a5fde63feb7a29ef2af4e9c080a0a3adf22f4ce9fead664befb0ca33730f3bb8edb1a1d65a7f5275ac9a8622d29ea01a99e171740d723ee61049d7f0465f4e219fca86aaddf06bab02d3400f554242"; | ||
|
||
nano_models.forEach(function (model) { | ||
test( | ||
"[Nano " + model.letter + "] Legacy Deposit ETH", | ||
zemu(model, async (sim, eth) => { | ||
const serializedTx = txFromEtherscan(inputData); | ||
|
||
const tx = eth.signTransaction("44'/60'/0'/0", serializedTx); | ||
|
||
const right_clicks = model.letter === "S" ? 9 : 5; | ||
|
||
// Wait for the application to actually load and parse the transaction | ||
await waitForAppScreen(sim); | ||
// Navigate the display by pressing the right button `right_clicks` times, then pressing both buttons to accept the transaction. | ||
await sim.navigateAndCompareSnapshots( | ||
".", | ||
testNetwork + "_ethx_" + model.name + "_legacy_stake_eth", | ||
[right_clicks, 0] | ||
); | ||
|
||
await tx; | ||
}), | ||
50000 | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import "core-js/stable"; | ||
import "regenerator-runtime"; | ||
import { | ||
waitForAppScreen, | ||
zemu, | ||
nano_models, | ||
serializeTx, | ||
txFromEtherscan, | ||
} from "../../test.fixture"; | ||
|
||
const contractAddr = "0xcf5ea1b38380f6af39068375516daf40ed70d299"; | ||
const pluginName = "staderlabs"; | ||
const testNetwork = "ethereum"; | ||
const chainID = 1; | ||
// Test from replayed transaction: https://etherscan.io/tx/0xa7b2f78c84bc5528629d37b56856d47601c42f4d7f1505fa6767bcd090fb5044 | ||
const inputData = | ||
"0x02f8b30182059585053f837bd185053f837bd18304d7be949f0491b32dbce587c50c4c43ab303b06478193a780b844ccc143b80000000000000000000000000000000000000000000000056a30e2758fb0a40000000000000000000000000087bc2f2ba8c83f412fed5c3151de0ffbdc959984c080a01bf62d962c7e2d888df40f0a61dd9eb6c60ed01e1291ce15b9acbad154e0cf619fc470d4477df1e52cb4030e2f976dc13856d09010d164dd97a5532d59b9d413"; | ||
|
||
nano_models.forEach(function (model) { | ||
test( | ||
"[Nano " + model.letter + "] Legacy Request Withdraw ETH", | ||
zemu(model, async (sim, eth) => { | ||
const serializedTx = txFromEtherscan(inputData); | ||
|
||
const tx = eth.signTransaction("44'/60'/0'/0", serializedTx); | ||
|
||
const right_clicks = model.letter === "S" ? 9 : 5; | ||
|
||
// Wait for the application to actually load and parse the transaction | ||
await waitForAppScreen(sim); | ||
// Navigate the display by pressing the right button `right_clicks` times, then pressing both buttons to accept the transaction. | ||
await sim.navigateAndCompareSnapshots( | ||
".", | ||
testNetwork + "_ethx_" + model.name + "_legacy_request_withdraw_eth", | ||
[right_clicks, 0] | ||
); | ||
|
||
await tx; | ||
}), | ||
50000 | ||
); | ||
}); |