-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathe2etests.go
808 lines (793 loc) · 24.4 KB
/
e2etests.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
package e2etests
import (
"github.com/zeta-chain/zetacore/e2e/runner"
)
// List of all e2e test names to be used in zetae2e
const (
/*
ZETA tests
Test transfer of ZETA asset across chains
*/
TestZetaDepositName = "zeta_deposit"
TestZetaDepositNewAddressName = "zeta_deposit_new_address"
TestZetaDepositRestrictedName = "zeta_deposit_restricted"
TestZetaWithdrawName = "zeta_withdraw"
TestZetaWithdrawBTCRevertName = "zeta_withdraw_btc_revert" // #nosec G101 - not a hardcoded password
/*
Message passing tests
Test message passing across chains
*/
TestMessagePassingExternalChainsName = "message_passing_external_chains"
TestMessagePassingRevertFailExternalChainsName = "message_passing_revert_fail"
TestMessagePassingRevertSuccessExternalChainsName = "message_passing_revert_success"
TestMessagePassingEVMtoZEVMName = "message_passing_evm_to_zevm"
TestMessagePassingZEVMToEVMName = "message_passing_zevm_to_evm"
TestMessagePassingZEVMtoEVMRevertName = "message_passing_zevm_to_evm_revert"
TestMessagePassingEVMtoZEVMRevertName = "message_passing_evm_to_zevm_revert"
TestMessagePassingZEVMtoEVMRevertFailName = "message_passing_zevm_to_evm_revert_fail"
TestMessagePassingEVMtoZEVMRevertFailName = "message_passing_evm_to_zevm_revert_fail"
/*
EVM gas tests
Test transfer of EVM gas asset across chains
*/
TestEtherDepositName = "eth_deposit"
TestEtherWithdrawName = "eth_withdraw"
TestEtherWithdrawRestrictedName = "eth_withdraw_restricted"
TestEtherDepositAndCallRefundName = "eth_deposit_and_call_refund"
TestEtherDepositAndCallName = "eth_deposit_and_call"
/*
EVM erc20 tests
Test transfer of EVM erc20 asset across chains
*/
TestERC20WithdrawName = "erc20_withdraw"
TestERC20DepositName = "erc20_deposit"
TestMultipleERC20DepositName = "erc20_multiple_deposit"
TestMultipleERC20WithdrawsName = "erc20_multiple_withdraw"
TestERC20DepositRestrictedName = "erc20_deposit_restricted" // #nosec G101: Potential hardcoded credentials (gosec), not a credential
TestERC20DepositAndCallRefundName = "erc20_deposit_and_call_refund"
/*
Solana tests
*/
TestSolanaDepositName = "solana_deposit"
TestSolanaWithdrawName = "solana_withdraw"
TestSolanaDepositAndCallName = "solana_deposit_and_call"
TestSolanaDepositAndCallRefundName = "solana_deposit_and_call_refund"
/*
Bitcoin tests
Test transfer of Bitcoin asset across chains
*/
TestBitcoinDepositName = "bitcoin_deposit"
TestBitcoinDepositRefundName = "bitcoin_deposit_refund"
TestBitcoinWithdrawSegWitName = "bitcoin_withdraw_segwit"
TestBitcoinWithdrawTaprootName = "bitcoin_withdraw_taproot"
TestBitcoinWithdrawMultipleName = "bitcoin_withdraw_multiple"
TestBitcoinWithdrawLegacyName = "bitcoin_withdraw_legacy"
TestBitcoinWithdrawP2WSHName = "bitcoin_withdraw_p2wsh"
TestBitcoinWithdrawP2SHName = "bitcoin_withdraw_p2sh"
TestBitcoinWithdrawInvalidAddressName = "bitcoin_withdraw_invalid"
TestBitcoinWithdrawRestrictedName = "bitcoin_withdraw_restricted"
/*
Application tests
Test various smart contract applications across chains
*/
TestZRC20SwapName = "zrc20_swap"
TestCrosschainSwapName = "crosschain_swap"
/*
Miscellaneous tests
Test various functionalities not related to assets
*/
TestContextUpgradeName = "context_upgrade"
TestMyTestName = "my_test"
TestDonationEtherName = "donation_ether"
/*
Stress tests
Test stressing networks with many cross-chain transactions
*/
TestStressEtherWithdrawName = "stress_eth_withdraw"
TestStressBTCWithdrawName = "stress_btc_withdraw"
TestStressEtherDepositName = "stress_eth_deposit"
TestStressBTCDepositName = "stress_btc_deposit"
/*
Admin tests
Test admin functionalities
*/
TestWhitelistERC20Name = "whitelist_erc20"
TestDepositEtherLiquidityCapName = "deposit_eth_liquidity_cap"
TestMigrateChainSupportName = "migrate_chain_support"
TestPauseZRC20Name = "pause_zrc20"
TestUpdateBytecodeZRC20Name = "update_bytecode_zrc20"
TestUpdateBytecodeConnectorName = "update_bytecode_connector"
TestRateLimiterName = "rate_limiter"
TestCriticalAdminTransactionsName = "critical_admin_transactions"
TestPauseERC20CustodyName = "pause_erc20_custody"
TestMigrateERC20CustodyFundsName = "migrate_erc20_custody_funds"
TestMigrateTSSName = "migrate_TSS"
/*
V2 smart contract tests
*/
TestV2ETHDepositName = "v2_eth_deposit"
TestV2ETHDepositAndCallName = "v2_eth_deposit_and_call"
TestV2ETHDepositAndCallRevertName = "v2_eth_deposit_and_call_revert"
TestV2ETHDepositAndCallRevertWithCallName = "v2_eth_deposit_and_call_revert_with_call"
TestV2ETHWithdrawName = "v2_eth_withdraw"
TestV2ETHWithdrawAndCallName = "v2_eth_withdraw_and_call"
TestV2ETHWithdrawAndCallRevertName = "v2_eth_withdraw_and_call_revert"
TestV2ETHWithdrawAndCallRevertWithCallName = "v2_eth_withdraw_and_call_revert_with_call"
TestV2ERC20DepositName = "v2_erc20_deposit"
TestV2ERC20DepositAndCallName = "v2_erc20_deposit_and_call"
TestV2ERC20DepositAndCallRevertName = "v2_erc20_deposit_and_call_revert"
TestV2ERC20DepositAndCallRevertWithCallName = "v2_erc20_deposit_and_call_revert_with_call"
TestV2ERC20WithdrawName = "v2_erc20_withdraw"
TestV2ERC20WithdrawAndCallName = "v2_erc20_withdraw_and_call"
TestV2ERC20WithdrawAndCallRevertName = "v2_erc20_withdraw_and_call_revert"
TestV2ERC20WithdrawAndCallRevertWithCallName = "v2_erc20_withdraw_and_call_revert_with_call"
TestV2ZEVMToEVMCallName = "v2_zevm_to_evm_call"
TestV2EVMToZEVMCallName = "v2_evm_to_zevm_call"
/*
Operational tests
Not used to test functionalities but do various interactions with the netwoks
*/
TestDeploy = "deploy"
TestOperationAddLiquidityETHName = "add_liquidity_eth"
TestOperationAddLiquidityERC20Name = "add_liquidity_erc20"
)
// AllE2ETests is an ordered list of all e2e tests
var AllE2ETests = []runner.E2ETest{
/*
ZETA tests
*/
runner.NewE2ETest(
TestZetaDepositName,
"deposit ZETA from Ethereum to ZEVM",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "1000000000000000000"},
},
TestZetaDeposit,
),
runner.NewE2ETest(
TestZetaDepositNewAddressName,
"deposit ZETA from Ethereum to a new ZEVM address which does not exist yet",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "1000000000000000000"},
},
TestZetaDepositNewAddress,
),
runner.NewE2ETest(
TestZetaDepositRestrictedName,
"deposit ZETA from Ethereum to ZEVM restricted address",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "1000000000000000000"},
},
TestZetaDepositRestricted,
),
runner.NewE2ETest(
TestZetaWithdrawName,
"withdraw ZETA from ZEVM to Ethereum",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000000"},
},
TestZetaWithdraw,
),
runner.NewE2ETest(
TestZetaWithdrawBTCRevertName,
"sending ZETA from ZEVM to Bitcoin with a message that should revert cctxs",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "1000000000000000000"},
},
TestZetaWithdrawBTCRevert,
),
/*
Message passing tests
*/
runner.NewE2ETest(
TestMessagePassingExternalChainsName,
"evm->evm message passing (sending ZETA only)",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000000"},
},
TestMessagePassingExternalChains,
),
runner.NewE2ETest(
TestMessagePassingRevertFailExternalChainsName,
"message passing with failing revert between external EVM chains",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000000"},
},
TestMessagePassingRevertFailExternalChains,
),
runner.NewE2ETest(
TestMessagePassingRevertSuccessExternalChainsName,
"message passing with successful revert between external EVM chains",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000000"},
},
TestMessagePassingRevertSuccessExternalChains,
),
runner.NewE2ETest(
TestMessagePassingEVMtoZEVMName,
"evm -> zevm message passing contract call ",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000009"},
},
TestMessagePassingEVMtoZEVM,
),
runner.NewE2ETest(
TestMessagePassingZEVMToEVMName,
"zevm -> evm message passing contract call",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000007"},
},
TestMessagePassingZEVMtoEVM,
),
runner.NewE2ETest(
TestMessagePassingZEVMtoEVMRevertName,
"zevm -> evm message passing contract call reverts",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000006"},
},
TestMessagePassingZEVMtoEVMRevert,
),
runner.NewE2ETest(
TestMessagePassingEVMtoZEVMRevertName,
"evm -> zevm message passing and revert back to evm",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000008"},
},
TestMessagePassingEVMtoZEVMRevert,
),
runner.NewE2ETest(
TestMessagePassingZEVMtoEVMRevertFailName,
"zevm -> evm message passing contract with failing revert",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000008"},
},
TestMessagePassingZEVMtoEVMRevertFail,
),
runner.NewE2ETest(
TestMessagePassingEVMtoZEVMRevertFailName,
"evm -> zevm message passing contract with failing revert",
[]runner.ArgDefinition{
{Description: "amount in azeta", DefaultValue: "10000000000000000008"},
},
TestMessagePassingEVMtoZEVMRevertFail,
),
/*
EVM gas tests
*/
runner.NewE2ETest(
TestEtherDepositName,
"deposit Ether into ZEVM",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "10000000000000000"},
},
TestEtherDeposit,
),
runner.NewE2ETest(
TestEtherWithdrawName,
"withdraw Ether from ZEVM",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
},
TestEtherWithdraw,
),
runner.NewE2ETest(
TestEtherWithdrawRestrictedName,
"withdraw Ether from ZEVM to restricted address",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
},
TestEtherWithdrawRestricted,
),
runner.NewE2ETest(
TestEtherDepositAndCallRefundName,
"deposit Ether into ZEVM and call a contract that reverts; should refund",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "10000000000000000000"},
},
TestEtherDepositAndCallRefund,
),
runner.NewE2ETest(
TestEtherDepositAndCallName,
"deposit ZRC20 into ZEVM and call a contract",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "1000000000000000000"},
},
TestEtherDepositAndCall,
),
/*
EVM erc20 tests
*/
runner.NewE2ETest(
TestERC20WithdrawName,
"withdraw ERC20 from ZEVM",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "1000"},
},
TestERC20Withdraw,
),
runner.NewE2ETest(
TestERC20DepositName,
"deposit ERC20 into ZEVM",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "100000"},
},
TestERC20Deposit,
),
runner.NewE2ETest(
TestMultipleERC20DepositName,
"deposit ERC20 into ZEVM in multiple deposits",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "1000000000"},
{Description: "count", DefaultValue: "3"},
},
TestMultipleERC20Deposit,
),
runner.NewE2ETest(
TestMultipleERC20WithdrawsName,
"withdraw ERC20 from ZEVM in multiple withdrawals",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "100"},
{Description: "count", DefaultValue: "3"},
},
TestMultipleERC20Withdraws,
),
runner.NewE2ETest(
TestERC20DepositRestrictedName,
"deposit ERC20 into ZEVM restricted address",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "100000"},
},
TestERC20DepositRestricted,
),
runner.NewE2ETest(
TestERC20DepositAndCallRefundName,
"deposit a non-gas ZRC20 into ZEVM and call a contract that reverts",
[]runner.ArgDefinition{},
TestERC20DepositAndCallRefund,
),
/*
Solana tests
*/
runner.NewE2ETest(
TestSolanaDepositName,
"deposit SOL into ZEVM",
[]runner.ArgDefinition{
{Description: "amount in lamport", DefaultValue: "1200000"},
},
TestSolanaDeposit,
),
runner.NewE2ETest(
TestSolanaWithdrawName,
"withdraw SOL from ZEVM",
[]runner.ArgDefinition{
{Description: "amount in lamport", DefaultValue: "1000000"},
},
TestSolanaWithdraw,
),
runner.NewE2ETest(
TestSolanaDepositAndCallName,
"deposit SOL into ZEVM and call a contract",
[]runner.ArgDefinition{
{Description: "amount in lamport", DefaultValue: "1200000"},
},
TestSolanaDepositAndCall,
),
runner.NewE2ETest(
TestSolanaDepositAndCallRefundName,
"deposit SOL into ZEVM and call a contract that reverts; should refund",
[]runner.ArgDefinition{
{Description: "amount in lamport", DefaultValue: "1200000"},
},
TestSolanaDepositAndCallRefund,
),
/*
Bitcoin tests
*/
runner.NewE2ETest(
TestBitcoinDepositName,
"deposit Bitcoin into ZEVM",
[]runner.ArgDefinition{
{Description: "amount in btc", DefaultValue: "0.001"},
},
TestBitcoinDeposit,
),
runner.NewE2ETest(
TestBitcoinDepositRefundName,
"deposit Bitcoin into ZEVM; expect refund", []runner.ArgDefinition{
{Description: "amount in btc", DefaultValue: "0.1"},
},
TestBitcoinDepositRefund,
),
runner.NewE2ETest(
TestBitcoinWithdrawSegWitName,
"withdraw BTC from ZEVM to a SegWit address",
[]runner.ArgDefinition{
{Description: "receiver address", DefaultValue: ""},
{Description: "amount in btc", DefaultValue: "0.001"},
},
TestBitcoinWithdrawSegWit,
),
runner.NewE2ETest(
TestBitcoinWithdrawTaprootName,
"withdraw BTC from ZEVM to a Taproot address",
[]runner.ArgDefinition{
{Description: "receiver address", DefaultValue: ""},
{Description: "amount in btc", DefaultValue: "0.001"},
},
TestBitcoinWithdrawTaproot,
),
runner.NewE2ETest(
TestBitcoinWithdrawLegacyName,
"withdraw BTC from ZEVM to a legacy address",
[]runner.ArgDefinition{
{Description: "receiver address", DefaultValue: ""},
{Description: "amount in btc", DefaultValue: "0.001"},
},
TestBitcoinWithdrawLegacy,
),
runner.NewE2ETest(
TestBitcoinWithdrawMultipleName,
"withdraw BTC from ZEVM multiple times",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "0.01"},
{Description: "times", DefaultValue: "2"},
},
WithdrawBitcoinMultipleTimes,
),
runner.NewE2ETest(
TestBitcoinWithdrawP2WSHName,
"withdraw BTC from ZEVM to a P2WSH address",
[]runner.ArgDefinition{
{Description: "receiver address", DefaultValue: ""},
{Description: "amount in btc", DefaultValue: "0.001"},
},
TestBitcoinWithdrawP2WSH,
),
runner.NewE2ETest(
TestBitcoinWithdrawP2SHName,
"withdraw BTC from ZEVM to a P2SH address",
[]runner.ArgDefinition{
{Description: "receiver address", DefaultValue: ""},
{Description: "amount in btc", DefaultValue: "0.001"},
},
TestBitcoinWithdrawP2SH,
),
runner.NewE2ETest(
TestBitcoinWithdrawInvalidAddressName,
"withdraw BTC from ZEVM to an unsupported btc address",
[]runner.ArgDefinition{
{Description: "amount in btc", DefaultValue: "0.00001"},
},
TestBitcoinWithdrawToInvalidAddress,
),
runner.NewE2ETest(
TestBitcoinWithdrawRestrictedName,
"withdraw Bitcoin from ZEVM to restricted address",
[]runner.ArgDefinition{
{Description: "amount in btc", DefaultValue: "0.001"},
},
TestBitcoinWithdrawRestricted,
),
/*
Application tests
*/
runner.NewE2ETest(
TestZRC20SwapName,
"swap ZRC20 ERC20 for ZRC20 ETH",
[]runner.ArgDefinition{},
TestZRC20Swap,
),
runner.NewE2ETest(
TestCrosschainSwapName,
"testing Bitcoin ERC20 cross-chain swap",
[]runner.ArgDefinition{},
TestCrosschainSwap,
),
/*
Miscellaneous tests
*/
runner.NewE2ETest(
TestContextUpgradeName,
"tests sending ETH on ZEVM and check context data using ContextApp",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "1000000000000000"},
},
TestContextUpgrade,
),
runner.NewE2ETest(
TestMyTestName,
"performing custom test",
[]runner.ArgDefinition{},
TestMyTest,
),
runner.NewE2ETest(
TestDonationEtherName,
"donate Ether to the TSS",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000000000000000"},
},
TestDonationEther,
),
/*
Stress tests
*/
runner.NewE2ETest(
TestStressEtherWithdrawName,
"stress test Ether withdrawal",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
{Description: "count", DefaultValue: "100"},
},
TestStressEtherWithdraw,
),
runner.NewE2ETest(
TestStressBTCWithdrawName,
"stress test BTC withdrawal",
[]runner.ArgDefinition{
{Description: "amount in btc", DefaultValue: "0.01"},
{Description: "count", DefaultValue: "100"},
},
TestStressBTCWithdraw,
),
runner.NewE2ETest(
TestStressEtherDepositName,
"stress test Ether deposit",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
{Description: "count", DefaultValue: "100"},
},
TestStressEtherDeposit,
),
runner.NewE2ETest(
TestStressBTCDepositName,
"stress test BTC deposit",
[]runner.ArgDefinition{
{Description: "amount in btc", DefaultValue: "0.001"},
{Description: "count", DefaultValue: "100"},
},
TestStressBTCDeposit,
),
/*
Admin tests
*/
runner.NewE2ETest(
TestWhitelistERC20Name,
"whitelist a new ERC20 token",
[]runner.ArgDefinition{},
TestWhitelistERC20,
),
runner.NewE2ETest(
TestDepositEtherLiquidityCapName,
"deposit Ethers into ZEVM with a liquidity cap",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000000000000"},
},
TestDepositEtherLiquidityCap,
),
runner.NewE2ETest(
TestMigrateChainSupportName,
"migrate the evm chain from goerli to sepolia",
[]runner.ArgDefinition{},
TestMigrateChainSupport,
),
runner.NewE2ETest(
TestPauseZRC20Name,
"pausing ZRC20 on ZetaChain",
[]runner.ArgDefinition{},
TestPauseZRC20,
),
runner.NewE2ETest(
TestUpdateBytecodeZRC20Name,
"update ZRC20 bytecode swap",
[]runner.ArgDefinition{},
TestUpdateBytecodeZRC20,
),
runner.NewE2ETest(
TestUpdateBytecodeConnectorName,
"update zevm connector bytecode",
[]runner.ArgDefinition{},
TestUpdateBytecodeConnector,
),
runner.NewE2ETest(
TestRateLimiterName,
"test sending cctxs with rate limiter enabled and show logs when processing cctxs",
[]runner.ArgDefinition{},
TestRateLimiter,
),
runner.NewE2ETest(
TestCriticalAdminTransactionsName,
"test critical admin transactions",
[]runner.ArgDefinition{},
TestCriticalAdminTransactions,
),
runner.NewE2ETest(
TestMigrateTSSName,
"migrate TSS funds",
[]runner.ArgDefinition{},
TestMigrateTSS,
),
runner.NewE2ETest(
TestPauseERC20CustodyName,
"pausing ERC20 custody on ZetaChain",
[]runner.ArgDefinition{},
TestPauseERC20Custody,
),
runner.NewE2ETest(
TestMigrateERC20CustodyFundsName,
"migrate ERC20 custody funds",
[]runner.ArgDefinition{},
TestMigrateERC20CustodyFunds,
),
/*
V2 smart contract tests
*/
runner.NewE2ETest(
TestV2ETHDepositName,
"deposit Ether into ZEVM using V2 contract",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000000000000000000"},
},
TestV2ETHDeposit,
),
runner.NewE2ETest(
TestV2ETHDepositAndCallName,
"deposit Ether into ZEVM and call a contract using V2 contract",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "10000000000000000"},
},
TestV2ETHDepositAndCall,
),
runner.NewE2ETest(
TestV2ETHDepositAndCallRevertName,
"deposit Ether into ZEVM and call a contract using V2 contract that reverts",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "10000000000000000"},
},
TestV2ETHDepositAndCallRevert,
),
runner.NewE2ETest(
TestV2ETHDepositAndCallRevertWithCallName,
"deposit Ether into ZEVM and call a contract using V2 contract that reverts with a onRevert call",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "10000000000000000"},
},
TestV2ETHDepositAndCallRevertWithCall,
),
runner.NewE2ETest(
TestV2ETHWithdrawName,
"withdraw Ether from ZEVM using V2 contract",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
},
TestV2ETHWithdraw,
),
runner.NewE2ETest(
TestV2ETHWithdrawAndCallName,
"withdraw Ether from ZEVM and call a contract using V2 contract",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
},
TestV2ETHWithdrawAndCall,
),
runner.NewE2ETest(
TestV2ETHWithdrawAndCallRevertName,
"withdraw Ether from ZEVM and call a contract using V2 contract that reverts",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
},
TestV2ETHWithdrawAndCallRevert,
),
runner.NewE2ETest(
TestV2ETHWithdrawAndCallRevertWithCallName,
"withdraw Ether from ZEVM and call a contract using V2 contract that reverts with a onRevert call",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
},
TestV2ETHWithdrawAndCallRevertWithCall,
),
runner.NewE2ETest(
TestV2ERC20DepositName,
"deposit ERC20 into ZEVM using V2 contract",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "100000000000000000000"},
},
TestV2ERC20Deposit,
),
runner.NewE2ETest(
TestV2ERC20DepositAndCallName,
"deposit ERC20 into ZEVM and call a contract using V2 contract",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "100000"},
},
TestV2ERC20DepositAndCall,
),
runner.NewE2ETest(
TestV2ERC20DepositAndCallRevertName,
"deposit ERC20 into ZEVM and call a contract using V2 contract that reverts",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "10000000000000000000"},
},
TestV2ERC20DepositAndCallRevert,
),
runner.NewE2ETest(
TestV2ERC20DepositAndCallRevertWithCallName,
"deposit ERC20 into ZEVM and call a contract using V2 contract that reverts with a onRevert call",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "10000000000000000000"},
},
TestV2ERC20DepositAndCallRevertWithCall,
),
runner.NewE2ETest(
TestV2ERC20WithdrawName,
"withdraw ERC20 from ZEVM using V2 contract",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "1000"},
},
TestV2ERC20Withdraw,
),
runner.NewE2ETest(
TestV2ERC20WithdrawAndCallName,
"withdraw ERC20 from ZEVM and call a contract using V2 contract",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "1000"},
},
TestV2ERC20WithdrawAndCall,
),
runner.NewE2ETest(
TestV2ERC20WithdrawAndCallRevertName,
"withdraw ERC20 from ZEVM and call a contract using V2 contract that reverts",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "1000"},
},
TestV2ERC20WithdrawAndCallRevert,
),
runner.NewE2ETest(
TestV2ERC20WithdrawAndCallRevertWithCallName,
"withdraw ERC20 from ZEVM and call a contract using V2 contract that reverts with a onRevert call",
[]runner.ArgDefinition{
{Description: "amount", DefaultValue: "1000"},
},
TestV2ERC20WithdrawAndCallRevertWithCall,
),
runner.NewE2ETest(
TestV2ZEVMToEVMCallName,
"zevm -> evm call using V2 contract",
[]runner.ArgDefinition{},
TestV2ZEVMToEVMCall,
),
runner.NewE2ETest(
TestV2EVMToZEVMCallName,
"evm -> zevm call using V2 contract",
[]runner.ArgDefinition{},
TestV2EVMToZEVMCall,
),
/*
Special tests
*/
runner.NewE2ETest(
TestDeploy,
"deploy a contract",
[]runner.ArgDefinition{
{Description: "contract name", DefaultValue: ""},
},
TestDeployContract,
),
runner.NewE2ETest(
TestOperationAddLiquidityETHName,
"add liquidity to the ZETA/ETH pool",
[]runner.ArgDefinition{
{Description: "amountZETA", DefaultValue: "50000000000000000000"},
{Description: "amountETH", DefaultValue: "50000000000000000000"},
},
TestOperationAddLiquidityETH,
),
runner.NewE2ETest(
TestOperationAddLiquidityERC20Name,
"add liquidity to the ZETA/ERC20 pool",
[]runner.ArgDefinition{
{Description: "amountZETA", DefaultValue: "50000000000000000000"},
{Description: "amountERC20", DefaultValue: "50000000000000000000"},
},
TestOperationAddLiquidityERC20,
),
}