-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
evmtest.go
23 lines (19 loc) · 1.1 KB
/
evmtest.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package v2
import (
"testing"
"github.com/smartcontractkit/chainlink/core/chains/evm/config"
v2 "github.com/smartcontractkit/chainlink/core/chains/evm/config/v2"
configtest "github.com/smartcontractkit/chainlink/core/internal/testutils/configtest/v2"
"github.com/smartcontractkit/chainlink/core/logger"
"github.com/smartcontractkit/chainlink/core/utils"
)
func ChainEthMainnet(t *testing.T) config.ChainScopedConfig { return scopedConfig(t, 1) }
func ChainOptimismMainnet(t *testing.T) config.ChainScopedConfig { return scopedConfig(t, 10) }
func ChainOptimismKovan(t *testing.T) config.ChainScopedConfig { return scopedConfig(t, 69) }
func ChainArbitrumMainnet(t *testing.T) config.ChainScopedConfig { return scopedConfig(t, 42161) }
func ChainArbitrumRinkeby(t *testing.T) config.ChainScopedConfig { return scopedConfig(t, 421611) }
func scopedConfig(t *testing.T, chainID int64) config.ChainScopedConfig {
id := utils.NewBigI(chainID)
evmCfg := v2.EVMConfig{ChainID: id, Chain: v2.Defaults(id)}
return v2.NewTOMLChainScopedConfig(configtest.NewTestGeneralConfig(t), &evmCfg, logger.TestLogger(t))
}