-
Notifications
You must be signed in to change notification settings - Fork 0
/
suites.go
70 lines (54 loc) · 2.76 KB
/
suites.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
// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
// Implements solidity tests.
package solidity
import (
"context"
"time"
"github.com/cgcardona/r-subnet-evm/tests/utils"
ginkgo "github.com/onsi/ginkgo/v2"
)
var _ = ginkgo.Describe("[Precompiles]", func() {
// Register the ping test first
utils.RegisterPingTest()
// Each ginkgo It node specifies the name of the genesis file (in ./tests/precompile/genesis/)
// to use to launch the subnet and the name of the TS test file to run on the subnet (in ./contracts/tests/)
ginkgo.It("contract native minter", ginkgo.Label("Precompile"), ginkgo.Label("ContractNativeMinter"), func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
utils.RunDefaultHardhatTests(ctx, utils.BlockchainIDs["contract_native_minter"], "contract_native_minter")
})
ginkgo.It("tx allow list", ginkgo.Label("Precompile"), ginkgo.Label("TxAllowList"), func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
utils.RunDefaultHardhatTests(ctx, utils.BlockchainIDs["tx_allow_list"], "tx_allow_list")
})
ginkgo.It("contract deployer allow list", ginkgo.Label("Precompile"), ginkgo.Label("ContractDeployerAllowList"), func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
utils.RunDefaultHardhatTests(ctx, utils.BlockchainIDs["contract_deployer_allow_list"], "contract_deployer_allow_list")
})
ginkgo.It("fee manager", ginkgo.Label("Precompile"), ginkgo.Label("FeeManager"), func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
utils.RunDefaultHardhatTests(ctx, utils.BlockchainIDs["fee_manager"], "fee_manager")
})
ginkgo.It("reward manager", ginkgo.Label("Precompile"), ginkgo.Label("RewardManager"), func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
utils.RunDefaultHardhatTests(ctx, utils.BlockchainIDs["reward_manager"], "reward_manager")
})
// and then runs the hardhat tests for each one without forcing precompile developers to modify this file.
// ADD YOUR PRECOMPILE HERE
/*
ginkgo.It("your precompile", ginkgo.Label("Precompile"), ginkgo.Label("YourPrecompile"), func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
// Specify the name shared by the genesis file in ./tests/precompile/genesis/{your_precompile}.json
// and the test file in ./contracts/tests/{your_precompile}.ts
// If you want to use a different test command and genesis path than the defaults, you can
// use the utils.RunTestCMD. See utils.RunDefaultHardhatTests for an example.
utils.RunDefaultHardhatTests(ctx, "your_precompile")
})
*/
})