-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from blooo-io/test/INCH-16-create-the-unoswapw…
…ithpermit-test-on-polygon Test/inch 16 create the unoswapwithpermit test on polygon
- Loading branch information
Showing
48 changed files
with
82 additions
and
0 deletions.
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
Binary file added
BIN
+374 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+389 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+362 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+384 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+445 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+351 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+384 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+419 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+344 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+509 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/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
+507 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/00010.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
+415 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/00011.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
+352 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/00012.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
+391 Bytes
tests/snapshots/polygon_nanos_fill_order_rfq_to_with_permit/00013.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/polygon_nanos_fill_order_rfq_to_with_permit/00014.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/polygon_nanos_fill_order_rfq_to_with_permit/00015.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.
Binary file added
BIN
+414 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00000.png
Oops, something went wrong.
Binary file added
BIN
+497 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00001.png
Oops, something went wrong.
Binary file added
BIN
+427 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00002.png
Oops, something went wrong.
Binary file added
BIN
+501 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00003.png
Oops, something went wrong.
Binary file added
BIN
+427 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00004.png
Oops, something went wrong.
Binary file added
BIN
+471 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00005.png
Oops, something went wrong.
Binary file added
BIN
+829 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00006.png
Oops, something went wrong.
Binary file added
BIN
+411 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00007.png
Oops, something went wrong.
Binary file added
BIN
+449 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00008.png
Oops, something went wrong.
Binary file added
BIN
+472 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00009.png
Oops, something went wrong.
Binary file added
BIN
+382 Bytes
tests/snapshots/polygon_nanox_fill_order_rfq_to_with_permit/00010.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.
Oops, something went wrong.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
tests/src/V4/fill_order_rfq_to_with_permit_polygon.test.js
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,35 @@ | ||
import { processTest, populateTransaction } from "../test.fixture"; | ||
|
||
const contractName = "AggregationRouterV4"; | ||
|
||
const testLabel = "fillOrderRFQToWithPermit"; // <= Name of the test | ||
const testDirSuffix = "fill_order_rfq_to_with_permit"; // <= directory to compare device snapshots to | ||
const signedPlugin = false; | ||
const testNetwork = "polygon"; | ||
|
||
const contractAddr = "0x1111111254fb6c44bac0bed2854e76f90643097d"; | ||
const chainID = 137; | ||
|
||
// The input data is extracted from a transaction on the ethereum blockchain | ||
// As the method on the smart contract take the same parameter we can take the input data of this transaction | ||
// From : https://etherscan.io/tx/0x9e011accd8fb355f6c7d222125b56ebdae914f3f119c6f51b85e77b82a4935b9 | ||
const inputData = "0x4cc4a27b0000000000000000000000000000000000000000626b92a5a920808096ecf6a4000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000b398ffef80144095b8712c70a0c09886c8151feb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111998dab0000000000000000000000000000000000000000000000000000000111a1f59b000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111a1f59b000000000000000000000000a7ecacd4d1438c24ed13795685037abc81b4a0ad00000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000041104cb670f1925fb98c09f628803f4464d963350432296121136a1195f5bf1b7a4f4d718f6a8218f9faf48d810b901be7fa778e7b56270698e9e71427fba90b5d1c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000a7ecacd4d1438c24ed13795685037abc81b4a0ad0000000000000000000000001111111254fb6c44bac0bed2854e76f90643097dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000626c41b0000000000000000000000000000000000000000000000000000000000000001cf589d90f676dcd03cbc287e010a697a00f6369fdbe7221ff5d7a9746b68b4e092e55fb68857d54dab6c6eef60058ead2ac51606356e2623e614c6c7529633c2ae26b9977"; | ||
const serializedTx = populateTransaction(contractAddr, inputData, chainID); | ||
|
||
const devices = [ | ||
{ | ||
name: "nanos", | ||
label: "Nano S", | ||
steps: 14, // <= Define the number of steps for this test case and this device | ||
}, | ||
{ | ||
name: "nanox", | ||
label: "Nano X", | ||
steps: 9, // <= Define the number of steps for this test case and this device | ||
} | ||
]; | ||
|
||
devices.forEach((device) =>{ | ||
processTest(device, contractName, testLabel, testDirSuffix, "", signedPlugin, serializedTx, testNetwork); | ||
} | ||
); |
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,45 @@ | ||
import { processTest, populateTransaction } from "../test.fixture"; | ||
|
||
const contractName = "AggregationRouterV4"; | ||
|
||
const testLabel = "unoswapWithPermit"; // <= Name of the test | ||
const testDirSuffix = "unoswap_with_permit"; // <= directory to compare device snapshots to | ||
const signedPlugin = false; | ||
const testNetwork = "polygon"; | ||
|
||
const contractAddr = "0x1111111254fb6c44bac0bed2854e76f90643097d"; | ||
const chainID = 137; | ||
|
||
const selector = "0xa1251d75"; | ||
const srcToken = "0000000000000000000000000000000000000000000000000000000000000000"; // Native token (MATIC) | ||
const amount = "0000000000000000000000000000000000000000000000056bc75e2d63100000"; // 100 MATIC | ||
const minReturn = "0000000000000000000000000000000000000000000000056bc75e2d63100000"; // 100 | ||
const offsetPools = "00000000000000000000000000000000000000000000000000000000000000a0"; // 160 in decimal | ||
const offsetPermit = "00000000000000000000000000000000000000000000000000000000000000e0"; // 224 in decimal | ||
const lengthPools = "0000000000000000000000000000000000000000000000000000000000000001"; // 1 | ||
|
||
// pools and permit taken from input data on a unoswapWithPermit call on ethereum transaction | ||
// From : https://etherscan.io/tx/0xed9ee640466e2f49a6eb6d0470d33efe9a6f01ecb45913ff473f46059167e957 | ||
const pools = "40000000000000003b6d0340ccb63225a7b19dcf66717e4d40c9a72b39331d61"; | ||
const permit = "00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000531516ca59544bf8ab2451a072b6fa94adf5a88c0000000000000000000000001111111254fb6c44bac0bed2854e76f90643097dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000062615a6f000000000000000000000000000000000000000000000000000000000000001c5af1afdeb28be04bc7012d6f63f7fbdcf9dada199d257f43854814d67047a109736ed2cfe2c9857276f6bf9140ce6cb58cd7cfcd42264338bd62140b64abc39de26b9977"; | ||
|
||
const inputData = selector + srcToken + amount + minReturn + offsetPools + offsetPermit + lengthPools + pools + permit; | ||
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: 7, // <= Define the number of steps for this test case and this device | ||
} | ||
]; | ||
|
||
devices.forEach((device) =>{ | ||
processTest(device, contractName, testLabel, testDirSuffix, "", signedPlugin, serializedTx, testNetwork); | ||
} | ||
); |