diff --git a/.github/workflows/integration-tests-api.yml b/.github/workflows/integration-tests-api.yml index 5bd9a4439c..f191349d4c 100644 --- a/.github/workflows/integration-tests-api.yml +++ b/.github/workflows/integration-tests-api.yml @@ -3,7 +3,6 @@ on: pull_request jobs: runTests: - name: Run API integration tests timeout-minutes: 30 runs-on: ubuntu-latest permissions: @@ -14,6 +13,7 @@ jobs: matrix: node-version: ['lts/*'] # 18.17.1 or lts/* test-pattern: + - accounts.test.ts - addresses.test.ts - batches.test.ts - blocks.test.ts @@ -22,6 +22,7 @@ jobs: - stats.test.ts - tokens.test.ts - transactions.test.ts + name: 'API test set: ${{ matrix.test-pattern}} / Node: ${{ matrix.node-version}}' steps: - name: Checkout with Submodule uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index ecbf0116b8..159e3cd3e1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,11 @@ cypress/videos/ cypress/screenshots/ tests/e2e/reports/ **/tests/e2e/artifacts/ +**/playbook/artifacts-zk/ +**/playbook/artifacts/ +**/playbook/buffer/ +**/playbook/cache-zk/ +**/playbook/cache/ # Logs logs diff --git a/packages/app/tests/e2e/features/copying.feature b/packages/app/tests/e2e/features/copying.feature index 6aa9b48c39..47c7adacb9 100644 --- a/packages/app/tests/e2e/features/copying.feature +++ b/packages/app/tests/e2e/features/copying.feature @@ -109,7 +109,7 @@ Feature: Copying Examples: | Text | - | 0x00030000000000020005000000000002000200000001035500000060011002700000010f0010019d000100000000001f0000008001000039000000400010043f00000001012001900000003c0000c13d0000000002000031000000040120008c000002990000413d0000000201000367000000000301043b000000e003300270000001110430009c000000440000a13d000001120430009c000000650000a13d000001130430009c000000e50000613d000001140130009c000002880000613d000001150130009c000002990000c13d0000000001000416000000000101004b000002990000c13d000000040100008a00000000011000310000011d02000041000000200310008c000000000300001900000000030240190000011d01100197000000000401004b000000000200a0190000011d0110009c00000000010300190000000001026019000000000101004b000002990000c13d00000004010000390000000201100367000000000101043b0000011e011001970000000000100435000000200000043f0000000001000019043503fb0000040f000000000101041a000000400200043d00000000001204350000010f010000410000010f0320009c000000000102401900000040011002100000011f011001c7000004360001042e0000000001000416000000000101004b000002990000c13d0000002001000039000001000010044300000120000004430000011001000041000004360001042e000001180130009c000000a20000213d0000011b0130009c000002080000613d0000011c0130009c000002990000c13d0000000001000416000000000101004b000002990000c13d000000040100008a00000000011000310000011d02000041000000000301004b000000000300001900000000030240190000011d01100197000000000401004b000000000200a0190000011d0110009c00000000010300190000000001026019000000000101004b000002990000c13d0000000101000039000000000101041a000000400200043d00000000001204350000010f010000410000010f0320009c000000000102401900000040011002100000011f011001c7000004360001042e000001160430009c000002300000613d000001170130009c000002990000c13d0000000001000416000000000101004b000002990000c13d000000040100008a00000000011000310000011d02000041000000600310008c000000000300001900000000030240190000011d01100197000000000401004b000000000200a0190000011d0110009c00000000010300190000000001026019000000000101004b000002990000c13d00000002010003670000000402100370000000000402043b0000011e0240009c000002990000213d0000002402100370000000000202043b0000011e052001970000011e0220009c000002990000213d00000000020004110000004401100370000000000301043b000080060120008c0000033b0000613d000000090100008a000000000112016f000080010110008c0000033b0000613d000000400100043d00000064021000390000012703000041000000000032043500000044021000390000012803000041000000000032043500000024021000390000003e030000390000000000320435000001290200004100000000002104350000000402100039000000200300003900000000003204350000010f020000410000010f0310009c000000000102801900000040011002100000012a011001c70000043700010430000001190130009c0000026e0000613d0000011a0130009c000002990000c13d0000000001000416000000000101004b000002990000c13d000000040100008a00000000011000310000011d02000041000000400310008c000000000300001900000000030240190000011d01100197000000000401004b000000000200a0190000011d0110009c00000000010300190000000001026019000000000101004b000002990000c13d00000002010003670000000402100370000000000402043b0000011e0240009c000002990000213d0000002401100370000000000501043b0000000001000411000080010110008c000002b50000c13d0000000101000039000000000301041a0000000002530019000000000332004b000000000300001900000001030040390000000103300190000000df0000c13d000400000005001d000000000021041b0000000000400435000000200000043f0000010f0100004100000000020004140000010f0320009c0000000001024019000000c00110021000000122011001c70000801002000039000500000004001d043504300000040f00000005050000290000000102200190000002990000613d000000000101043b000000000201041a0000000403000029000000000232001a000000df0000413d000003880000013d000001310100004100000000001004350000001101000039000000040010043f00000132010000410000043700010430000000040320008a0000011d04000041000000400530008c000000000500001900000000050440190000011d03300197000000000603004b000000000400a0190000011d0330009c00000000030500190000000003046019000000000303004b000002990000c13d0000000403100370000000000803043b0000011e0380009c000002990000213d0000002403100370000000000303043b000001210430009c000002990000213d00000023043000390000011d05000041000000000624004b000000000600001900000000060580190000011d022001970000011d04400197000000000724004b0000000005008019000000000224013f0000011d0220009c00000000020600190000000002056019000000000202004b000002990000c13d0000000402300039000000000121034f000000000101043b000001210210009c000002680000213d000000bf02100039000000200500008a000000000252016f000001210420009c000002680000213d000000400020043f000000800010043f000000240330003900000000023100190000000004000031000000000242004b000002990000213d000400000005001d0000001f0210018f00000002033003670000000504100272000001280000613d00000000050000190000000506500210000000000763034f000000000707043b000000a00660003900000000007604350000000105500039000000000645004b000001200000413d000500000008001d000000000502004b000001380000613d0000000504400210000000000343034f0000000302200210000000a004400039000000000504043300000000052501cf000000000525022f000000000303043b0000010002200089000000000323022f00000000022301cf000000000252019f0000000000240435000000a00110003900000000000104350000000001000416000300000001001d00000000010004100000000000100435000000200000043f0000010f0100004100000000020004140000010f0320009c0000000001024019000000c00110021000000122011001c70000801002000039043504300000040f000000010220019000000005040000290000000407000029000002990000613d000000000101043b000000000201041a00000003090000290000000002920049000000000021041b0000000101000039000000000201041a0000000002920049000000000021041b0000012302000041000000400100043d000000200310003900000000002304350000006002400210000000240310003900000000002304350000000008000411000000600280021000000058031000390000000000230435000000380210003900000000009204350000006c03100039000000800200043d000000000402004b0000016d0000613d00000000040000190000000005340019000000a006400039000000000606043300000000006504350000002004400039000000000524004b000001660000413d000000000332001900000000000304350000004c0320003900000000003104350000008b02200039000000000272016f000000000a12001900000000022a004b000000000200001900000001020040390000012103a0009c000002680000213d0000000102200190000002680000c13d000100000008001d0000004000a0043f000001240200004100000000002a04350000000402a000390000002003000039000000000032043500000000020104330000002403a0003900000000002304350000004403a00039000000000402004b000001900000613d000000000400001900000000053400190000002004400039000000000614001900000000060604330000000000650435000000000524004b000001890000413d000000000132001900000000000104350000001f01200039000000000171016f0000010f020000410000010f03a0009c000000000302001900000000030a4019000000400330021000000044011000390000010f0410009c00000000010280190000006001100210000000000131019f00000000030004140000010f0430009c0000000002034019000000c002200210000000000112019f000080080200003900020000000a001d0435042b0000040f000000020a000029000000000301001900000060033002700000010f03300197000000200430008c000000200400003900000000040340190000001f0540018f0000000506400272000001b90000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b000001b10000413d000000000705004b000001c80000613d0000000506600210000000000761034f00000000066a00190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f0000000000560435000100000003001f0000000102200190000003d50000613d0000001f01400039000000600210018f0000000001a20019000000000221004b00000000020000190000000102004039000001210410009c00000005040000290000000305000029000002680000213d0000000102200190000002680000c13d000000400010043f000000200230008c000002990000413d00000020021000390000004003000039000000000032043500000000005104350000004003100039000000800200043d000000000023043500000060031000390000011e06400197000000000402004b000001ed0000613d00000000040000190000000005340019000000a007400039000000000707043300000000007504350000002004400039000000000524004b000001e60000413d000000000332001900000000000304350000007f022000390000000403000029000000000232016f0000010f030000410000010f0410009c000000000103801900000040011002100000010f0420009c00000000020380190000006002200210000000000112019f00000000020004140000010f0420009c0000000002038019000000c002200210000000000112019f00000125011001c70000800d020000390000000303000039000001260400004100000001050000290435042b0000040f0000000101200190000003d30000c13d000002990000013d0000000001000416000000000101004b000002990000c13d000000040100008a00000000011000310000011d02000041000000000301004b000000000300001900000000030240190000011d01100197000000000401004b000000000200a0190000011d0110009c00000000010300190000000001026019000000000101004b000002990000c13d000000c001000039000000400010043f0000000501000039000000800010043f0000013501000041000000a00010043f0000002001000039000000400200043d000500000002001d000000000212043600000080010000390435040d0000040f000000050400002900000000014100490000010f020000410000010f0310009c00000000010280190000010f0340009c000000000204401900000040022002100000006001100210000000000121019f000004360001042e000000040220008a0000011d03000041000000200420008c000000000400001900000000040340190000011d02200197000000000502004b000000000300a0190000011d0220009c00000000020400190000000002036019000000000202004b000002990000c13d0000000401100370000000000401043b0000011e0140009c000002990000213d0000000001000416000400000001001d00000000010004100000000000100435000000200000043f0000010f0100004100000000020004140000010f0320009c0000000001024019000000c00110021000000122011001c70000801002000039000500000004001d043504300000040f00000005040000290000000102200190000002990000613d000000000101043b000000000201041a00000004050000290000000002520049000000000021041b0000000101000039000000000201041a0000000002520049000000000021041b0000012302000041000000400100043d0000002003100039000000000023043500000060024002100000002403100039000000000023043500000038021000390000000000520435000000380200003900000000002104350000012f0210009c000002c70000413d000001310100004100000000001004350000004101000039000000040010043f000001320100004100000437000104300000000001000416000000000101004b000002990000c13d000000040100008a00000000011000310000011d02000041000000000301004b000000000300001900000000030240190000011d01100197000000000401004b000000000200a0190000011d0110009c00000000010300190000000001026019000000000101004b000002990000c13d000000400100043d000000120200003900000000002104350000010f020000410000010f0310009c000000000102801900000040011002100000011f011001c7000004360001042e0000000001000416000000000101004b000002990000c13d000000040100008a00000000011000310000011d02000041000000000301004b000000000300001900000000030240190000011d01100197000000000401004b000000000200a0190000011d0110009c00000000010300190000000001026019000000000101004b0000029b0000613d00000000010000190000043700010430000000400100043d000400000001001d043504200000040f00000004030000290000002001300039000001200200004100000000002104350000000301000039000000000013043500000000010300190000002002000039000000400300043d000500000003001d00000000022304360435040d0000040f000000050400002900000000014100490000010f020000410000010f0310009c00000000010280190000010f0340009c000000000204401900000040022002100000006001100210000000000121019f000004360001042e000000400100043d00000044021000390000013303000041000000000032043500000024021000390000001f030000390000000000320435000001290200004100000000002104350000000402100039000000200300003900000000003204350000010f020000410000010f0310009c000000000102801900000040011002100000012e011001c700000437000104300000006007100039000000400070043f00000124020000410000000000270435000000640210003900000020030000390000000000320435000000840310003900000000020104330000000000230435000000a403100039000000000402004b000002dc0000613d000000000400001900000000053400190000002004400039000000000614001900000000060604330000000000650435000000000524004b000002d50000413d000000000132001900000000000104350000001f01200039000000200200008a000000000121016f0000010f020000410000010f0370009c00000000030200190000000003074019000000400330021000000044011000390000010f0410009c00000000010280190000006001100210000000000131019f00000000030004140000010f0430009c0000000002034019000000c002200210000000000112019f0000800802000039000300000007001d0435042b0000040f000000030a000029000000000301001900000060033002700000010f03300197000000200430008c000000200400003900000000040340190000001f0540018f0000000506400272000003060000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b000002fe0000413d000000000705004b000003150000613d0000000506600210000000000761034f00000000066a00190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f0000000000560435000100000003001f0000000102200190000003620000613d0000001f01400039000000600210018f0000000001a20019000000000221004b00000000020000190000000102004039000001210410009c00000005050000290000000404000029000002680000213d0000000102200190000002680000c13d000000400010043f000000200230008c000002990000413d00000000004104350000010f0200004100000000030004140000010f0430009c00000000030280190000010f0410009c00000000010280190000004001100210000000c002300210000000000112019f0000012b011001c70000011e065001970000800d020000390000000303000039000001300400004100000000050004110435042b0000040f0000000101200190000003d30000c13d000002990000013d000400000003001d0000000000400435000000200000043f0000010f0100004100000000020004140000010f0320009c0000000001024019000000c00110021000000122011001c70000801002000039000500000004001d000300000005001d043504300000040f00000005030000290000000102200190000002990000613d000000000101043b000000000201041a0000000401000029000000000112004b0000039c0000813d000000400100043d00000044021000390000012d03000041000000000032043500000024021000390000001f030000390000000000320435000001290200004100000000002104350000000402100039000000200300003900000000003204350000010f020000410000010f0310009c000000000102801900000040011002100000012e011001c70000043700010430000000400200043d0000001f0430018f00000005033002720000036f0000613d000000000500001900000005065002100000000007620019000000000661034f000000000606043b00000000006704350000000105500039000000000635004b000003670000413d000000000504004b0000037e0000613d0000000503300210000000000131034f00000000033200190000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000010f0100004100000001030000310000010f0430009c00000000030180190000010f0420009c000000000102401900000040011002100000006002300210000000000112019f0000043700010430000000000021041b000000400100043d00000000003104350000010f0200004100000000030004140000010f0430009c00000000030280190000010f0410009c00000000010280190000004001100210000000c002300210000000000112019f0000012b011001c70000800d02000039000000020300003900000134040000410435042b0000040f0000000101200190000002990000613d000003d30000013d000200000002001d0000000000300435000000200000043f0000010f0100004100000000020004140000010f0320009c0000000001024019000000c00110021000000122011001c70000801002000039043504300000040f00000003030000290000000102200190000002990000613d000000040200002900000002040000290000000002240049000000000101043b000000000021041b00000000003004350000010f0100004100000000020004140000010f0320009c0000000001024019000000c00110021000000122011001c70000801002000039043504300000040f000000030600002900000005050000290000000102200190000002990000613d000000000101043b000000000201041a00000004030000290000000002320019000000000021041b000000400100043d00000000003104350000010f0200004100000000030004140000010f0430009c00000000030280190000010f0410009c00000000010280190000004001100210000000c002300210000000000112019f0000012b011001c70000800d0200003900000003030000390000012c040000410435042b0000040f0000000101200190000002990000613d0000000001000019000004360001042e000000400200043d0000001f0430018f0000000503300272000003e20000613d000000000500001900000005065002100000000007620019000000000661034f000000000606043b00000000006704350000000105500039000000000635004b000003da0000413d000000000504004b000003f10000613d0000000503300210000000000131034f00000000033200190000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000010f0100004100000001030000310000010f0430009c00000000030180190000010f0420009c000000000102401900000040011002100000006002300210000000000112019f00000437000104300000010f0200004100000000030004140000010f0430009c00000000030280190000010f0410009c00000000010280190000004001100210000000c002300210000000000112019f00000122011001c70000801002000039043504300000040f00000001022001900000040b0000613d000000000101043b000000000001042d0000000001000019000004370001043000000000030104330000000002320436000000000403004b000004190000613d000000000400001900000000052400190000002004400039000000000614001900000000060604330000000000650435000000000534004b000004120000413d000000000123001900000000000104350000001f01300039000000200300008a000000000131016f0000000001120019000000000001042d000001360210009c000004250000813d0000004001100039000000400010043f000000000001042d000001310100004100000000001004350000004101000039000000040010043f000001320100004100000437000104300000042e002104210000000102000039000000000001042d0000000002000019000000000001042d00000433002104230000000102000039000000000001042d0000000002000019000000000001042d0000043500000432000004360001042e0000043700010430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000002000000000000000000000000000000400000010000000000000000000000000000000000000000000000000000000000000000000000000051cff8d80000000000000000000000000000000000000000000000000000000084bc3eaf0000000000000000000000000000000000000000000000000000000084bc3eb00000000000000000000000000000000000000000000000000000000095d89b41000000000000000000000000000000000000000000000000000000009cc7f7080000000000000000000000000000000000000000000000000000000051cff8d900000000000000000000000000000000000000000000000000000000579952fc00000000000000000000000000000000000000000000000000000000313ce56600000000000000000000000000000000000000000000000000000000313ce5670000000000000000000000000000000000000000000000000000000040c10f190000000000000000000000000000000000000000000000000000000006fdde030000000000000000000000000000000000000000000000000000000018160ddd8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000200000000000000000000000004554480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff02000000000000000000000000000000000000400000000000000000000000006c0960f90000000000000000000000000000000000000000000000000000000062f84b24000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000c405fe8958410bbaf0c73b7a0c3e20859e86ca168a4c9b0def9c54d2555a306b616c206163636573732063616e2063616c6c2074686973206d6574686f6400004f6e6c792073797374656d20636f6e747261637473207769746820737065636908c379a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000840000000000000000000000000200000000000000000000000000000000000020000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5472616e7366657220616d6f756e7420657863656564732062616c616e6365000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffa02717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b63984e487b7100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000043616c6c61626c65206f6e6c792062792074686520626f6f746c6f61646572000f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968854574686572000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffc000000000000000000000000000000000000000000000000000000000000000007b3ba959bf7eac2739d6ef137ed2b810585c27a9dbd1782f8efe2a761831b7e4 | + | 0x00050000000000020000008003000039000000400030043f00000000030100190000006003300270000000d7033001970000000102200190000000240000c13d000000040230008c0000030a0000413d000000000201043b000000e002200270000000d90420009c0000002c0000a13d000000da0420009c000000380000a13d000000db0420009c000000950000613d000000dc0420009c000001ea0000613d000000dd0220009c0000030a0000c13d0000000002000416000000000202004b0000030a0000c13d000000040230008a000000200220008c0000030a0000413d0000000401100370000000000101043b000000e5011001970000000000100435000000200000043f00000000010000190358033c0000040f000000360000013d0000000001000416000000000101004b0000030a0000c13d000000200100003900000100001004430000012000000443000000d801000041000003590001042e000000e00420009c000000600000213d000000e30120009c000001a60000613d000000e40120009c0000030a0000c13d0000000001000416000000000101004b0000030a0000c13d0000000101000039000000000101041a000001e70000013d000000de0420009c000001af0000613d000000df0220009c0000030a0000c13d0000000002000416000000000202004b0000030a0000c13d000000040230008a000000600220008c0000030a0000413d0000000402100370000000000402043b000000e50240009c0000030a0000213d0000002402100370000000000202043b000000e505200197000000e50220009c0000030a0000213d00000000020004110000004401100370000000000301043b000080060120008c000002090000613d000000090100008a000000000112016f000080010110008c000002090000613d000000f001000041000000800010043f0000002001000039000000840010043f0000003e01000039000000a40010043f000000f101000041000000c40010043f000000f201000041000000e40010043f000000f3010000410000035a00010430000000e10420009c000001e30000613d000000e20220009c0000030a0000c13d0000000002000416000000000202004b0000030a0000c13d000000040230008a000000400220008c0000030a0000413d0000000402100370000000000402043b000000e50240009c0000030a0000213d0000002401100370000000000501043b0000000001000411000080010110008c000001ff0000c13d0000000101000039000000000301041a0000000002530019000000000332004b000000000300001900000001030040390000000103300190000000910000c13d000400000005001d000000000021041b0000000000400435000000200000043f000000d7010000410000000002000414000000d70320009c0000000002018019000000c001200210000000eb011001c70000801002000039000500000004001d035803530000040f000000050500002900000001022001900000030a0000613d000000000101043b000000000201041a0000000403000029000000000232001a000000910000413d000002c20000013d000000fa0100004100000000001004350000001101000039000001e00000013d000000040230008a000000400220008c0000030a0000413d0000000402100370000000000802043b000000e50280009c0000030a0000213d0000002402100370000000000402043b000000e90240009c0000030a0000213d0000002302400039000000ea05000041000000000632004b00000000060000190000000006058019000000ea02200197000000000702004b0000000005008019000000ea0220009c000000000506c019000000000205004b0000030a0000c13d0000000405400039000000000251034f000000000202043b000000e90620009c000001dd0000213d000000bf06200039000000200900008a000000000696016f000000e90760009c000001dd0000213d000000400060043f000000800020043f00000000042400190000002404400039000000000334004b0000030a0000213d0000002003500039000000000131034f0000001f0320018f0000000504200272000000ca0000613d00000000050000190000000506500210000000000761034f000000000707043b000000a00660003900000000007604350000000105500039000000000645004b000000c20000413d000400000009001d000500000008001d000000000503004b000000db0000613d0000000504400210000000000141034f0000000303300210000000a004400039000000000504043300000000053501cf000000000535022f000000000101043b0000010003300089000000000131022f00000000013101cf000000000151019f0000000000140435000000a00120003900000000000104350000000001000416000300000001001d00000000010004100000000000100435000000200000043f000000d7010000410000000002000414000000d70320009c0000000002018019000000c001200210000000eb011001c70000801002000039035803530000040f0000000102200190000000050400002900000004070000290000030a0000613d000000000101043b000000000201041a00000003090000290000000002920049000000000021041b0000000101000039000000000201041a0000000002920049000000000021041b000000ec02000041000000400100043d000000200310003900000000002304350000006002400210000000240310003900000000002304350000000008000411000000600280021000000058031000390000000000230435000000380210003900000000009204350000006c03100039000000800200043d000000000402004b000001100000613d00000000040000190000000005340019000000a006400039000000000606043300000000006504350000002004400039000000000524004b000001090000413d000000000332001900000000000304350000004c0320003900000000003104350000008b02200039000000000272016f000000000a12001900000000022a004b00000000020000190000000102004039000000e903a0009c000001dd0000213d0000000102200190000001dd0000c13d000100000008001d0000004000a0043f000000ed0200004100000000002a04350000000402a000390000002003000039000000000032043500000000020104330000002403a0003900000000002304350000004403a00039000000000402004b000001330000613d000000000400001900000000053400190000002004400039000000000614001900000000060604330000000000650435000000000524004b0000012c0000413d000000000132001900000000000104350000001f01200039000000000171016f000000d702000041000000d703a0009c000000000302001900000000030a401900000040033002100000004401100039000000d70410009c00000000010280190000006001100210000000000131019f0000000003000414000000d70430009c0000000003028019000000c002300210000000000112019f000080080200003900020000000a001d0358034e0000040f000000020a00002900000000030100190000006003300270000000d703300197000000200430008c000000000403001900000020040080390000001f0540018f00000005064002720000015c0000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b000001540000413d000000000705004b0000016b0000613d0000000506600210000000000761034f00000000066a00190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f000000000056043500000001022001900000030c0000613d0000001f01400039000000600210018f0000000001a20019000000000221004b00000000020000190000000102004039000000e90410009c00000005040000290000000305000029000001dd0000213d0000000102200190000001dd0000c13d000000400010043f000000200230008c0000030a0000413d00000020021000390000004003000039000000000032043500000000005104350000004003100039000000800200043d00000000002304350000006003100039000000e506400197000000000402004b0000018f0000613d00000000040000190000000005340019000000a007400039000000000707043300000000007504350000002004400039000000000524004b000001880000413d000000000332001900000000000304350000007f02200039000000040220017f000000d703000041000000d70410009c00000000010380190000004001100210000000d70420009c00000000020380190000006002200210000000000112019f0000000002000414000000d70420009c0000000002038019000000c002200210000000000112019f000000ee011001c70000800d020000390000000303000039000000ef040000410000000105000029000003050000013d0000000001000416000000000101004b0000030a0000c13d000000c001000039000000400010043f0000000501000039000000800010043f000000ff01000041000001f20000013d000000040230008a000000200220008c0000030a0000413d0000000401100370000000000401043b000000e50140009c0000030a0000213d0000000001000416000400000001001d00000000010004100000000000100435000000200000043f000000d7010000410000000002000414000000d70320009c0000000002018019000000c001200210000000eb011001c70000801002000039000500000004001d035803530000040f000000050400002900000001022001900000030a0000613d000000000101043b000000000201041a00000004050000290000000002520049000000000021041b0000000101000039000000000201041a0000000002520049000000000021041b000000ec02000041000000400100043d000000200310003900000000002304350000006002400210000000240310003900000000002304350000003802100039000000000052043500000038020000390000000000210435000000f80210009c0000022f0000413d000000fa0100004100000000001004350000004101000039000000040010043f000000fb010000410000035a000104300000000001000416000000000101004b0000030a0000c13d0000001201000039000000800010043f000000e601000041000003590001042e0000000001000416000000000101004b0000030a0000c13d000000c001000039000000400010043f0000000301000039000000800010043f000000e701000041000000a00010043f0000002001000039000000c00010043f0000008001000039000000e002000039035803290000040f000000c00110008a000000d702000041000000d70310009c00000000010280190000006001100210000000e8011001c7000003590001042e000000f001000041000000800010043f0000002001000039000000840010043f0000001f01000039000000a40010043f000000fc01000041000000c40010043f000000fd010000410000035a00010430000400000003001d0000000000400435000000200000043f000000d7010000410000000002000414000000d70320009c0000000002018019000000c001200210000000eb011001c70000801002000039000500000004001d000300000005001d035803530000040f000000050300002900000001022001900000030a0000613d000000000101043b000000000201041a000000040120006c000002d30000813d000000400100043d0000004402100039000000f603000041000000000032043500000024021000390000001f030000390000000000320435000000f0020000410000000000210435000000040210003900000020030000390000000000320435000000d702000041000000d70310009c00000000010280190000004001100210000000f7011001c70000035a000104300000006007100039000000400070043f000000ed020000410000000000270435000000640210003900000020030000390000000000320435000000840310003900000000020104330000000000230435000000a403100039000000000402004b000002440000613d000000000400001900000000053400190000002004400039000000000614001900000000060604330000000000650435000000000524004b0000023d0000413d000000000132001900000000000104350000001f01200039000000200200008a000000000121016f000000d702000041000000d70370009c0000000003020019000000000307401900000040033002100000004401100039000000d70410009c00000000010280190000006001100210000000000131019f0000000003000414000000d70430009c0000000003028019000000c002300210000000000112019f0000800802000039000300000007001d0358034e0000040f000000030a00002900000000030100190000006003300270000000d703300197000000200430008c000000000403001900000020040080390000001f0540018f00000005064002720000026e0000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b000002660000413d000000000705004b0000027d0000613d0000000506600210000000000761034f00000000066a00190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f000000000056043500000001022001900000029f0000613d0000001f01400039000000600210018f0000000001a20019000000000221004b00000000020000190000000102004039000000e90410009c00000005050000290000000404000029000001dd0000213d0000000102200190000001dd0000c13d000000400010043f000000200230008c0000030a0000413d0000000000410435000000d7020000410000000003000414000000d70430009c0000000003028019000000d70410009c00000000010280190000004001100210000000c002300210000000000112019f000000f4011001c7000000e5065001970000800d0200003900000003030000390000000005000411000000f904000041000003050000013d000000400200043d0000001f0430018f0000000505300272000002ac0000613d000000000600001900000005076002100000000008720019000000000771034f000000000707043b00000000007804350000000106600039000000000756004b000002a40000413d000000000604004b000002bb0000613d0000000505500210000000000151034f00000000055200190000000304400210000000000605043300000000064601cf000000000646022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000161019f0000000000150435000000d701000041000000d70420009c000000000201801900000040012002100000006002300210000000000121019f0000035a00010430000000000021041b000000400100043d0000000000310435000000d7020000410000000003000414000000d70430009c0000000003028019000000d70410009c00000000010280190000004001100210000000c002300210000000000112019f000000f4011001c70000800d020000390000000203000039000000fe04000041000003050000013d000200000002001d0000000000300435000000200000043f000000d7030000410000000001000414000000d70210009c0000000001038019000000c001100210000000eb011001c70000801002000039035803530000040f000000030300002900000001022001900000030a0000613d0000000204000029000000040240006a000000000101043b000000000021041b00000000003004350000000001000414000000d70210009c000000d701008041000000c001100210000000eb011001c70000801002000039035803530000040f0000000306000029000000050500002900000001022001900000030a0000613d000000000101043b000000000201041a00000004030000290000000002320019000000000021041b000000400100043d0000000000310435000000d7020000410000000003000414000000d70430009c0000000003028019000000d70410009c00000000010280190000004001100210000000c002300210000000000112019f000000f4011001c70000800d020000390000000303000039000000f5040000410358034e0000040f00000001012001900000030a0000613d0000000001000019000003590001042e00000000010000190000035a00010430000000400200043d0000001f0430018f0000000505300272000003190000613d000000000600001900000005076002100000000008720019000000000771034f000000000707043b00000000007804350000000106600039000000000756004b000003110000413d000000000604004b000003280000613d0000000505500210000000000151034f00000000055200190000000304400210000000000605043300000000064601cf000000000646022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000161019f0000000000150435000002bb0000013d00000000030104330000000002320436000000000403004b000003350000613d000000000400001900000000052400190000002004400039000000000614001900000000060604330000000000650435000000000534004b0000032e0000413d000000000123001900000000000104350000001f01300039000000200300008a000000000131016f0000000001120019000000000001042d000000d702000041000000d70310009c00000000010280190000000003000414000000d70430009c0000000003028019000000c0023002100000004001100210000000000121019f000000eb011001c70000801002000039035803530000040f00000001022001900000034c0000613d000000000101043b000000000001042d00000000010000190000035a0001043000000351002104210000000102000039000000000001042d0000000002000019000000000001042d00000356002104230000000102000039000000000001042d0000000002000019000000000001042d0000035800000432000003590001042e0000035a00010430000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000002000000000000000000000000000000400000010000000000000000000000000000000000000000000000000000000000000000000000000051cff8d80000000000000000000000000000000000000000000000000000000084bc3eaf0000000000000000000000000000000000000000000000000000000084bc3eb00000000000000000000000000000000000000000000000000000000095d89b41000000000000000000000000000000000000000000000000000000009cc7f7080000000000000000000000000000000000000000000000000000000051cff8d900000000000000000000000000000000000000000000000000000000579952fc00000000000000000000000000000000000000000000000000000000313ce56600000000000000000000000000000000000000000000000000000000313ce5670000000000000000000000000000000000000000000000000000000040c10f190000000000000000000000000000000000000000000000000000000006fdde030000000000000000000000000000000000000000000000000000000018160ddd000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000002000000080000000000000000045544800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff800000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000400000000000000000000000006c0960f90000000000000000000000000000000000000000000000000000000062f84b24000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000c405fe8958410bbaf0c73b7a0c3e20859e86ca168a4c9b0def9c54d2555a306b08c379a0000000000000000000000000000000000000000000000000000000004f6e6c792073797374656d20636f6e7472616374732077697468207370656369616c206163636573732063616e2063616c6c2074686973206d6574686f64000000000000000000000000000000000000000000840000008000000000000000000200000000000000000000000000000000000020000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5472616e7366657220616d6f756e7420657863656564732062616c616e6365000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffa02717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b63984e487b7100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000043616c6c61626c65206f6e6c792062792074686520626f6f746c6f616465720000000000000000000000000000000000000000640000008000000000000000000f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968854574686572000000000000000000000000000000000000000000000000000000f0b6b42807e1cedc08bb5d52497201e58eadf5d98c44d22f30deb9673d25565c | @id266:I @testnet Scenario Outline: Check "" hashes copying on Block page diff --git a/packages/app/tests/e2e/features/redirection/redirectionSet1.feature b/packages/app/tests/e2e/features/redirection/redirectionSet1.feature index ab2e4c44a9..5f4bb8eafb 100644 --- a/packages/app/tests/e2e/features/redirection/redirectionSet1.feature +++ b/packages/app/tests/e2e/features/redirection/redirectionSet1.feature @@ -13,7 +13,7 @@ Feature: Redirection Examples: | Extra button name | url | - | Docs | https://era.zksync.io/docs/dev/ | + | Docs | https://docs.zksync.io/build/ | | Terms | https://zksync.io/terms | | Contact | https://zksync.io/contact | @@ -32,7 +32,7 @@ Feature: Redirection @id251 Scenario: Verify redirection for Documentation link Given I click by text "Documentation" - Then New page have "https://era.zksync.io/docs/dev/" address + Then New page have "https://docs.zksync.io/build/" address @id252 Scenario Outline: Verify redirection for "" in BE menu @@ -80,12 +80,12 @@ Feature: Redirection @id253:IV @featureEnv @mainnet Scenario Outline: Verify redirection for "" in Tools menu Given I click by text "Tools " - When I click by element with partial href "" and text "" + When I click by element with partial href "" and text "" Then New page have "" address Examples: - | Sub-Section | url | - | Portal | https://staging-portal.zksync.dev/ | + | Sub-Section | url | redirect_url | + | Portal | https://staging-portal.zksync.dev/bridge/ | https://staging-portal.zksync.dev | @id253:IV @productionEnv @mainnet diff --git a/packages/integration-tests/src/helper.ts b/packages/integration-tests/src/helper.ts index 92605228d1..ea9b8c7964 100644 --- a/packages/integration-tests/src/helper.ts +++ b/packages/integration-tests/src/helper.ts @@ -1,9 +1,14 @@ import { execSync } from "child_process"; +import { ethers } from "ethers"; import { promises as fs } from "fs"; import * as path from "path"; +import { Provider } from "zksync-web3"; +import { localConfig } from "./config"; import { Logger } from "./entities"; +import type { BaseProvider } from "@ethersproject/providers/src.ts/base-provider"; + export class Helper { async txHashLogger(txType: string, txValue: string, tokenName?: string) { const logMessage = `TxHash for ${txType} ${Logger.textSeparator} ${txValue}`; @@ -35,4 +40,19 @@ export class Helper { console.log(`There is no the expected file: ${fileName}`); } } + + async getBalanceETH(walletAddress: string, layer: string) { + let network: string; + let provider: BaseProvider; + if (layer == "L1") { + network = localConfig.L1Network; + provider = ethers.getDefaultProvider(network); + } else if (layer == "L2") { + network = localConfig.L2Network; + provider = new Provider(network); + } else { + console.log(`Wrong layer: ${layer}`); + } + return ethers.utils.formatUnits(await provider.getBalance(walletAddress), "wei"); + } } diff --git a/packages/integration-tests/tests/api/accounts.test.ts b/packages/integration-tests/tests/api/accounts.test.ts new file mode 100644 index 0000000000..e28716351f --- /dev/null +++ b/packages/integration-tests/tests/api/accounts.test.ts @@ -0,0 +1,109 @@ +import * as request from "supertest"; +import { setTimeout } from "timers/promises"; + +import { environment } from "../../src/config"; +import { localConfig } from "../../src/config"; +import { Token, Wallets } from "../../src/entities"; +import { Helper } from "../../src/helper"; + +describe("API module: Account", () => { + jest.setTimeout(localConfig.standardTimeout); + + const helper = new Helper(); + //@id1704 + it("Verify /api?module=account&action=balancemulti response", async () => { + const apiRoute = `/api?module=account&action=balancemulti&address=${Wallets.richWalletAddress},${Wallets.mainWalletAddress}`; + const richWalletBalance = await helper.getBalanceETH(Wallets.richWalletAddress, "L2"); + const mainWalletBalance = await helper.getBalanceETH(Wallets.mainWalletAddress, "L2"); + const richWalletLowerCase = Wallets.richWalletAddress.toLowerCase(); + const mainWalletLowerCase = Wallets.mainWalletAddress.toLowerCase(); + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body.result.length).toBeGreaterThan(1)) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => + expect(res.body.result[0]).toStrictEqual( + expect.objectContaining({ account: richWalletLowerCase, balance: richWalletBalance }) + ) + ) + .expect((res) => + expect(res.body.result[1]).toStrictEqual( + expect.objectContaining({ account: mainWalletLowerCase, balance: mainWalletBalance }) + ) + ); + }); + + //@id1703 + it("Verify /api?module=account&action=balance response", async () => { + const apiRoute = `/api?module=account&action=balance&address=${Wallets.richWalletAddress}`; + const balance = await helper.getBalanceETH(Wallets.richWalletAddress, "L2"); + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ result: balance }))); + }); + + //@id1705 + it("Verify /api?module=account&action=tokenbalance response", async () => { + const apiRoute = `/api?module=account&action=tokenbalance&contractaddress=${Token.ETHER_ERC20_Address}&address=${Wallets.richWalletAddress}`; + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => expect(typeof res.body.result).toStrictEqual("string")); + }); + + //@id1702 + it("Verify /api?module=account&action=txlist response", async () => { + const blocks = await request(environment.blockExplorerAPI).get("/blocks"); + + const blockNumber = blocks.body.items[0].number; + const apiRoute = `/api?module=account&action=txlist&page=1&offset=10&sort=desc&endblock${blockNumber}&startblock=0&address=${Wallets.richWalletAddress}`; + + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body.result.length).toBeGreaterThan(1)) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => expect(typeof res.body.result[0].blockNumber).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].timeStamp).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].hash).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].nonce).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].blockHash).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].transactionIndex).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].from).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].to).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].value).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].gas).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].gasPrice).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].isError).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].txreceipt_status).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].input).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].contractAddress).toBeTruthy()) // can be null + .expect((res) => expect(typeof res.body.result[0].cumulativeGasUsed).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].gasUsed).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].confirmations).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].fee).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].commitTxHash).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].proveTxHash).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].executeTxHash).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].isL1Originated).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].l1BatchNumber).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].methodId).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result[0].functionName).toStrictEqual("string")); + }); +}); diff --git a/packages/integration-tests/tests/api/batches.test.ts b/packages/integration-tests/tests/api/batches.test.ts index 0a481e6819..ed9b15b314 100644 --- a/packages/integration-tests/tests/api/batches.test.ts +++ b/packages/integration-tests/tests/api/batches.test.ts @@ -4,7 +4,7 @@ import { setTimeout } from "timers/promises"; import { environment } from "../../src/config"; import { localConfig } from "../../src/config"; -describe("/batches", () => { +describe("Batches", () => { jest.setTimeout(localConfig.standardTimeout); //@id1513 @@ -30,8 +30,8 @@ describe("/batches", () => { }); //@id1514 - xit("Verify the response via /batches/{batchNumber}", async () => { - await setTimeout(localConfig.standardPause); //works unstable without timeout + it("Verify the response via /batches/{batchNumber}", async () => { + await setTimeout(localConfig.extendedPause); //works unstable without timeout const batches = await request(environment.blockExplorerAPI).get("/batches"); @@ -56,6 +56,6 @@ describe("/batches", () => { .expect((res) => expect(typeof res.body.l1GasPrice).toStrictEqual("string")) .expect((res) => expect(typeof res.body.l2FairGasPrice).toStrictEqual("string")) .expect((res) => expect(typeof res.body.size).toStrictEqual("number")) - .expect((res) => expect(res.body.status).toStrictEqual("string")); + .expect((res) => expect(typeof res.body.status).toStrictEqual("string")); }); }); diff --git a/packages/integration-tests/tests/api/blocks.test.ts b/packages/integration-tests/tests/api/blocks.test.ts index 989c07bf9f..90049e5200 100644 --- a/packages/integration-tests/tests/api/blocks.test.ts +++ b/packages/integration-tests/tests/api/blocks.test.ts @@ -4,7 +4,7 @@ import { setTimeout } from "timers/promises"; import { environment } from "../../src/config"; import { localConfig } from "../../src/config"; -describe("/blocks", () => { +describe("Blocks", () => { jest.setTimeout(localConfig.standardTimeout); //@id1511 @@ -66,3 +66,58 @@ describe("/blocks", () => { ); }); }); + +describe("/api?module=block", () => { + //@id1700 + it("Verify /api?module=block&action=getblockcountdown&blockno={block_number} response", async () => { + const blocks = await request(environment.blockExplorerAPI).get("/blocks"); + + const blockNumber = blocks.body.items[0].number + 1; + const apiRoute = `/api?module=block&action=getblockcountdown&blockno=${blockNumber}`; + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => expect(typeof res.body.result.CurrentBlock).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result.CountdownBlock).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result.RemainingBlock).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result.EstimateTimeInSec).toStrictEqual("string")); + }); + + //@id1699 + it("Verify /api?module=block&action=getblocknobytime&closest=before×tamp={timestamp} response", async () => { + const apiRoute = `/api?module=block&action=getblocknobytime&closest=before×tamp=1635934550`; + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => expect(typeof res.body.result).toStrictEqual("string")); + }); + + //@id1701 + it("Verify /api?module=block&action=getblockreward&blockno={blockNumber} response", async () => { + const blocks = await request(environment.blockExplorerAPI).get("/blocks"); + + const blockNumber = blocks.body.items[0].number; + const apiRoute = `/api?module=block&action=getblockreward&blockno=${blockNumber}`; + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => expect(typeof res.body.result.blockNumber).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result.timeStamp).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result.blockMiner).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result.blockReward).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result.uncleInclusionReward).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.result.uncles).toStrictEqual("object")); + }); +}); diff --git a/packages/integration-tests/tests/api/contracts.test.ts b/packages/integration-tests/tests/api/contracts.test.ts index c1d99b5b06..f15b341af8 100644 --- a/packages/integration-tests/tests/api/contracts.test.ts +++ b/packages/integration-tests/tests/api/contracts.test.ts @@ -1,4 +1,5 @@ import * as request from "supertest"; +import { setTimeout } from "timers/promises"; import { environment } from "../../src/config"; import { localConfig } from "../../src/config"; @@ -6,7 +7,7 @@ import { Buffer, Wallets } from "../../src/entities"; import { Helper } from "../../src/helper"; import { Playbook } from "../../src/playbook/playbook"; -describe("Contracts API", () => { +describe("API module: Contract", () => { jest.setTimeout(localConfig.standardTimeout); const helper = new Helper(); @@ -24,7 +25,8 @@ describe("Contracts API", () => { }); //@id1696 - xit("Verify the response via /api?module=contract&action=getcontractcreation&contractaddresses={address1},{address2}", async () => { + it("Verify /api?module=contract&action=getcontractcreation&contractaddresses={address1},{address2} response", async () => { + await setTimeout(localConfig.standardPause); paymasterContract = await helper.getStringFromFile(bufferFile + Buffer.paymaster); paymasterTx = await helper.getStringFromFile(bufferFile + Buffer.paymasterDeployTx); multicallCallerContract = await helper.getStringFromFile(bufferFile + Buffer.addressMultiCallCaller); diff --git a/packages/integration-tests/tests/api/logs.test.ts b/packages/integration-tests/tests/api/logs.test.ts index a8eb4f19d4..d41c78addb 100644 --- a/packages/integration-tests/tests/api/logs.test.ts +++ b/packages/integration-tests/tests/api/logs.test.ts @@ -1,4 +1,5 @@ import * as request from "supertest"; +import { setTimeout } from "timers/promises"; import { environment } from "../../src/config"; import { localConfig } from "../../src/config"; @@ -6,7 +7,7 @@ import { Buffer } from "../../src/entities"; import { Helper } from "../../src/helper"; import { Playbook } from "../../src/playbook/playbook"; -xdescribe("Logs API", () => { +describe("API module: Logs", () => { jest.setTimeout(localConfig.standardTimeout); //works unstable without timeout const helper = new Helper(); const bufferFile = "src/playbook/"; @@ -21,7 +22,8 @@ xdescribe("Logs API", () => { }); //@id1808 - it("Verify the response via /api?module=logs&action=getLogs&page={page}&offset={offset}0&toBlock={toBlock}&fromBlock={fromBlock}&address={address}", async () => { + it("Verify /api?module=logs&action=getLogs&page={page}&offset={offset}0&toBlock={toBlock}&fromBlock={fromBlock}&address={address} response", async () => { + await setTimeout(localConfig.standardPause); contractAddress = await helper.getStringFromFile(bufferFile + Buffer.greeterL2); txHash = await helper.getStringFromFile(bufferFile + Buffer.executeGreeterTx); @@ -42,7 +44,7 @@ xdescribe("Logs API", () => { .expect((res) => expect(res.body.result[0].data.length).toBe(194)) .expect((res) => expect(typeof res.body.result[0].blockNumber).toStrictEqual("string")) .expect((res) => expect(res.body.result[0].blockNumber.startsWith("0x")).toBe(true)) - .expect((res) => expect(res.body.result[0].blockNumber.length).toBe(5)) + .expect((res) => expect(typeof res.body.result[0].blockNumber.length).toStrictEqual("number")) .expect((res) => expect(typeof res.body.result[0].timeStamp).toStrictEqual("string")) .expect((res) => expect(res.body.result[0].timeStamp.startsWith("0x")).toBe(true)) .expect((res) => expect(res.body.result[0].timeStamp.length).toBe(10)) diff --git a/packages/integration-tests/tests/api/stats.test.ts b/packages/integration-tests/tests/api/stats.test.ts index 970e947af4..140e9e8a3a 100644 --- a/packages/integration-tests/tests/api/stats.test.ts +++ b/packages/integration-tests/tests/api/stats.test.ts @@ -4,7 +4,7 @@ import { setTimeout } from "timers/promises"; import { environment } from "../../src/config"; import { localConfig } from "../../src/config"; -describe("/stats", () => { +describe("Stats", () => { jest.setTimeout(localConfig.standardTimeout); //works unstable without timeout //@id1515 diff --git a/packages/integration-tests/tests/api/transactions.test.ts b/packages/integration-tests/tests/api/transactions.test.ts index 103d1222e8..ac120fc3b2 100644 --- a/packages/integration-tests/tests/api/transactions.test.ts +++ b/packages/integration-tests/tests/api/transactions.test.ts @@ -146,8 +146,8 @@ describe("Transactions", () => { }); //@id1463 - xit("Verify the custom token withdrawal via /transactions/{transactionHash}/transfers", async () => { - await setTimeout(localConfig.standardPause); //works unstable without timeout + it("Verify the custom token withdrawal via /transactions/{transactionHash}/transfers", async () => { + await setTimeout(localConfig.extendedPause); //works unstable without timeout const l1Token = bufferFile + "/" + Buffer.L1; const customTokenL1 = await helper.getStringFromFile(l1Token); @@ -166,17 +166,46 @@ describe("Transactions", () => { .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ to: Token.ETHER_PULL_Address })) ) + .expect((res) => expect(typeof res.body.items[0].blockNumber).toStrictEqual("number")) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ transactionHash: txHash }))) + .expect((res) => expect(typeof res.body.items[0].timestamp).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].amount).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].tokenAddress).toStrictEqual("string")) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ type: "fee" }))) + .expect((res) => expect(typeof res.body.items[0].tokenType).toStrictEqual("string")) + .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) + .expect((res) => expect(typeof res.body.items[0].isInternal).toBeTruthy()) + .expect((res) => + expect(res.body.items[0]).toStrictEqual( + expect.objectContaining({ + token: { + l2Address: Token.ETHER_ERC20_Address, + l1Address: Token.ETHER_Address, + symbol: "ETH", + name: "Ether", + decimals: 18, + iconURL: "https://assets.coingecko.com/coins/images/279/large/ethereum.png?1698873266", + liquidity: 220000000000, + usdPrice: 1800, + }, + }) + ) + ) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ from: Wallets.richWalletAddress })) ) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ to: Token.ETHER_Address }))) + .expect((res) => expect(typeof res.body.items[1].blockNumber).toStrictEqual("number")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ transactionHash: txHash }))) + .expect((res) => expect(typeof res.body.items[1].timestamp).toStrictEqual("string")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ amount: "200000000000000000" })) ) + .expect((res) => expect(typeof res.body.items[1].tokenAddress).toStrictEqual("string")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ type: "transfer" }))) + .expect((res) => expect(typeof res.body.items[1].tokenType).toStrictEqual("string")) + .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ fields: null }))) + .expect((res) => expect(typeof res.body.items[1].isInternal).toBeTruthy()) .expect((res) => expect(res.body.items[1]).toStrictEqual( expect.objectContaining({ @@ -186,6 +215,9 @@ describe("Transactions", () => { symbol: "L1", name: "L1 ERC20 token", decimals: 18, + iconURL: null, + liquidity: null, + usdPrice: null, }, }) ) @@ -196,13 +228,19 @@ describe("Transactions", () => { .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ to: Wallets.mainWalletAddress })) ) + .expect((res) => expect(typeof res.body.items[2].blockNumber).toStrictEqual("number")) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ transactionHash: txHash }))) + .expect((res) => expect(typeof res.body.items[2].timestamp).toStrictEqual("string")) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ amount: "200000000000000000" })) ) + .expect((res) => expect(typeof res.body.items[2].tokenAddress).toStrictEqual("string")) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ type: "withdrawal" }))) + .expect((res) => expect(typeof res.body.items[2].tokenType).toStrictEqual("string")) + .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ fields: null }))) + .expect((res) => expect(typeof res.body.items[2].isInternal).toBeTruthy()) .expect((res) => - expect(res.body.items[1]).toStrictEqual( + expect(res.body.items[2]).toStrictEqual( expect.objectContaining({ token: { l2Address: customTokenL2, @@ -210,6 +248,9 @@ describe("Transactions", () => { symbol: "L1", name: "L1 ERC20 token", decimals: 18, + iconURL: null, + liquidity: null, + usdPrice: null, }, }) ) @@ -433,7 +474,7 @@ describe("Transactions", () => { }); }); - xdescribe("/transactions/{transactionHash}/transfers", () => { + describe("/transactions/{transactionHash}/transfers", () => { beforeAll(async () => { await playbook.deployViaPaymaster(); await playbook.usePaymaster(); @@ -441,12 +482,11 @@ describe("Transactions", () => { //@id1481 it("Verify transaction for the ETH via /transactions/{transactionHash}/transfers", async () => { - await setTimeout(localConfig.standardPause); //works unstable without timeout + await setTimeout(localConfig.extendedPause); //works unstable without timeout contract = await helper.getStringFromFile(bufferFile + Buffer.addressMultiTransferETH); txHash = await helper.getStringFromFile(bufferFile + Buffer.txMultiTransferETH); const apiRoute = `/transactions/${txHash}/transfers?page=1&limit=10`; - return request(environment.blockExplorerAPI) .get(apiRoute) .expect(200) @@ -456,43 +496,79 @@ describe("Transactions", () => { .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ to: Token.ETHER_PULL_Address })) ) + .expect((res) => expect(typeof res.body.items[0].blockNumber).toStrictEqual("number")) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ transactionHash: txHash }))) + .expect((res) => expect(typeof res.body.items[0].timestamp).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].amount).toStrictEqual("string")) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ tokenAddress: Token.ETHER_ERC20_Address })) ) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ type: TransactionsType.fee })) ) + .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ tokenType: "ETH" }))) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))) + .expect((res) => expect(typeof res.body.items[0].isInternal).toBeTruthy()) + .expect((res) => expect(typeof res.body.items[0].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ from: Wallets.richWalletAddress })) ) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ to: contract }))) + .expect((res) => expect(typeof res.body.items[1].blockNumber).toStrictEqual("number")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ transactionHash: txHash }))) + .expect((res) => expect(typeof res.body.items[1].timestamp).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].amount).toStrictEqual("string")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ tokenAddress: Token.ETHER_ERC20_Address })) ) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ type: TransactionsType.transfer })) ) + .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ tokenType: "ETH" }))) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ token: null }))) + .expect((res) => expect(typeof res.body.items[1].isInternal).toBeTruthy()) + .expect((res) => expect(typeof res.body.items[1].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ from: Token.ETHER_PULL_Address })) ) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ to: Wallets.richWalletAddress })) ) + .expect((res) => expect(typeof res.body.items[2].blockNumber).toStrictEqual("number")) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ transactionHash: txHash }))) + .expect((res) => expect(typeof res.body.items[2].timestamp).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].amount).toStrictEqual("string")) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ tokenAddress: Token.ETHER_ERC20_Address })) ) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) + .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ tokenType: "ETH" }))) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(typeof res.body.items[2].isInternal).toBeTruthy()) + .expect((res) => expect(typeof res.body.items[2].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[2].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[2].token.usdPrice).toStrictEqual("number")); }); //@id1482 @@ -520,6 +596,14 @@ describe("Transactions", () => { .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ type: TransactionsType.fee })) ) + .expect((res) => expect(typeof res.body.items[0].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ from: Wallets.richWalletAddress })) @@ -540,6 +624,9 @@ describe("Transactions", () => { symbol: "L2", name: "L2 ERC20 token", decimals: 18, + iconURL: null, + liquidity: null, + usdPrice: null, }, }) ) @@ -558,7 +645,14 @@ describe("Transactions", () => { expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(typeof res.body.items[2].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[2].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[2].token.usdPrice).toStrictEqual("number")); }); //@id1483 @@ -611,6 +705,9 @@ describe("Transactions", () => { symbol: "L1", name: "L1 ERC20 token", decimals: 18, + iconURL: null, + liquidity: null, + usdPrice: null, }, }) ) @@ -629,7 +726,14 @@ describe("Transactions", () => { expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(typeof res.body.items[2].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[2].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[2].token.usdPrice).toStrictEqual("number")); }); //@id1452 @@ -663,6 +767,9 @@ describe("Transactions", () => { symbol: "MyToken", name: "MyToken", decimals: 18, + iconURL: null, + liquidity: null, + usdPrice: null, }, }) ) @@ -679,7 +786,14 @@ describe("Transactions", () => { expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ type: TransactionsType.fee })) ) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ token: null }))) + .expect((res) => expect(typeof res.body.items[1].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ from: Token.ETHER_PULL_Address })) ) @@ -692,7 +806,14 @@ describe("Transactions", () => { expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[2]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(typeof res.body.items[2].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[2].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[2].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[2].token.usdPrice).toStrictEqual("number")); }); //@id1455 @@ -720,7 +841,14 @@ describe("Transactions", () => { expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ type: TransactionsType.fee })) ) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))) + .expect((res) => expect(typeof res.body.items[0].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ from: Token.ETHER_PULL_Address })) ) @@ -735,7 +863,14 @@ describe("Transactions", () => { expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(typeof res.body.items[1].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.usdPrice).toStrictEqual("number")); }); //@id1472 @@ -764,7 +899,14 @@ describe("Transactions", () => { expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ type: TransactionsType.fee })) ) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))) + .expect((res) => expect(typeof res.body.items[0].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ from: Token.ETHER_PULL_Address })) ) @@ -778,8 +920,15 @@ describe("Transactions", () => { .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ fields: null }))) + .expect((res) => expect(typeof res.body.items[1].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.usdPrice).toStrictEqual("number")); }); //@id1473 @@ -808,7 +957,14 @@ describe("Transactions", () => { expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ type: TransactionsType.fee })) ) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))) + .expect((res) => expect(typeof res.body.items[0].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ from: Token.ETHER_PULL_Address })) ) @@ -822,8 +978,15 @@ describe("Transactions", () => { .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ fields: null }))) + .expect((res) => expect(typeof res.body.items[1].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.usdPrice).toStrictEqual("number")); }); //@id1474 @@ -852,7 +1015,14 @@ describe("Transactions", () => { expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ type: TransactionsType.fee })) ) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))) + .expect((res) => expect(typeof res.body.items[0].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ from: Token.ETHER_PULL_Address })) ) @@ -866,8 +1036,15 @@ describe("Transactions", () => { .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ fields: null }))) + .expect((res) => expect(typeof res.body.items[1].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.usdPrice).toStrictEqual("number")); }); //@id1475 @@ -895,7 +1072,14 @@ describe("Transactions", () => { expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ type: TransactionsType.fee })) ) .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))) + .expect((res) => expect(typeof res.body.items[0].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[0].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[0].token.usdPrice).toStrictEqual("number")) .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ from: Token.ETHER_PULL_Address })) ) @@ -909,8 +1093,15 @@ describe("Transactions", () => { .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ type: TransactionsType.refund })) ) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ fields: null }))) - .expect((res) => expect(res.body.items[0]).toStrictEqual(expect.objectContaining({ token: null }))); + .expect((res) => expect(res.body.items[1]).toStrictEqual(expect.objectContaining({ fields: null }))) + .expect((res) => expect(typeof res.body.items[1].token.l2Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.l1Address).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.symbol).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.name).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.decimals).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.iconURL).toStrictEqual("string")) + .expect((res) => expect(typeof res.body.items[1].token.liquidity).toStrictEqual("number")) + .expect((res) => expect(typeof res.body.items[1].token.usdPrice).toStrictEqual("number")); }); }); @@ -997,4 +1188,36 @@ describe("Transactions", () => { .expect((res) => expect(typeof res.body.links.last).toStrictEqual("string")); }); }); + + describe("/api?module=transaction", () => { + //@id1697 + it("Verify /api?module=transaction&action=getstatus response", async () => { + txHash = await helper.getStringFromFile(bufferFile + Buffer.txEthTransfer); + const apiRoute = `/api?module=transaction&action=getstatus&txhash=${txHash}`; + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => + expect(res.body.result).toStrictEqual(expect.objectContaining({ isError: "0", errDescription: "" })) + ); + }); + + //@id1698 + it("Verify /api?module=transaction&action=gettxreceiptstatus response", async () => { + txHash = await helper.getStringFromFile(bufferFile + Buffer.txEthTransfer); + const apiRoute = `/api?module=transaction&action=gettxreceiptstatus&txhash=${txHash}`; + await setTimeout(localConfig.extendedPause); //works unstable without timeout + + return request(environment.blockExplorerAPI) + .get(apiRoute) + .expect(200) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ status: "1" }))) + .expect((res) => expect(res.body).toStrictEqual(expect.objectContaining({ message: "OK" }))) + .expect((res) => expect(typeof res.body.result.status).toStrictEqual("string")); + }); + }); });