@@ -36,68 +36,67 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
3636 evmChainID1 , evmChainID2 := ubig .New (big .NewInt (1 )), ubig .New (big .NewInt (2 ))
3737 solanaChainID1 , solanaChainID2 := "solana-id-1" , "solana-id-2"
3838
39- cfg := configtest .NewGeneralConfig (t , func (c * chainlink.Config , s * chainlink.Secrets ) {
40- cfg := toml .Defaults (evmChainID1 )
41- node1_1 := toml.Node {
42- Name : ptr ("Test node chain1:1" ),
43- WSURL : commonconfig .MustParseURL ("ws://localhost:8546" ),
44- HTTPURL : commonconfig .MustParseURL ("http://localhost:8546" ),
45- SendOnly : ptr (false ),
46- Order : ptr (int32 (15 )),
47- }
48- node1_2 := toml.Node {
49- Name : ptr ("Test node chain1:2" ),
50- WSURL : commonconfig .MustParseURL ("ws://localhost:8547" ),
51- HTTPURL : commonconfig .MustParseURL ("http://localhost:8547" ),
52- SendOnly : ptr (false ),
53- Order : ptr (int32 (36 )),
54- }
55- node2_1 := toml.Node {
56- Name : ptr ("Test node chain2:1" ),
57- WSURL : commonconfig .MustParseURL ("ws://localhost:8547" ),
58- HTTPURL : commonconfig .MustParseURL ("http://localhost:8547" ),
59- SendOnly : ptr (false ),
60- Order : ptr (int32 (11 )),
61- }
62- c .EVM [0 ] = & toml.EVMConfig {
63- ChainID : evmChainID1 ,
64- Enabled : ptr (true ),
65- Chain : cfg ,
66- Nodes : toml.EVMNodes {& node1_1 , & node1_2 },
67- }
68- id2 := ubig .New (big .NewInt (2 ))
69- c .EVM = append (c .EVM , & toml.EVMConfig {
70- ChainID : evmChainID2 ,
71- Chain : toml .Defaults (id2 ),
72- Enabled : ptr (true ),
73- Nodes : toml.EVMNodes {& node2_1 },
74- })
75-
76- solChainCfg := solcfg.Chain {}
77- solChainCfg .SetDefaults ()
78-
79- c .Solana = solcfg.TOMLConfigs {
80- & solcfg.TOMLConfig {
81- ChainID : & solanaChainID1 ,
39+ newConfig := func () chainlink.GeneralConfig {
40+ return configtest .NewGeneralConfig (t , func (c * chainlink.Config , s * chainlink.Secrets ) {
41+ node1_1 := toml.Node {
42+ Name : ptr ("Test node chain1:1" ),
43+ WSURL : commonconfig .MustParseURL ("ws://localhost:8546" ),
44+ HTTPURL : commonconfig .MustParseURL ("http://localhost:8546" ),
45+ SendOnly : ptr (false ),
46+ Order : ptr (int32 (15 )),
47+ }
48+ node1_2 := toml.Node {
49+ Name : ptr ("Test node chain1:2" ),
50+ WSURL : commonconfig .MustParseURL ("ws://localhost:8547" ),
51+ HTTPURL : commonconfig .MustParseURL ("http://localhost:8547" ),
52+ SendOnly : ptr (false ),
53+ Order : ptr (int32 (36 )),
54+ }
55+ node2_1 := toml.Node {
56+ Name : ptr ("Test node chain2:1" ),
57+ WSURL : commonconfig .MustParseURL ("ws://localhost:8547" ),
58+ HTTPURL : commonconfig .MustParseURL ("http://localhost:8547" ),
59+ SendOnly : ptr (false ),
60+ Order : ptr (int32 (11 )),
61+ }
62+ c .EVM [0 ] = & toml.EVMConfig {
63+ ChainID : evmChainID1 ,
8264 Enabled : ptr (true ),
83- Chain : solChainCfg ,
84- Nodes : []* solcfg.Node {{
85- Name : ptr ("solana chain 1 node 1" ),
86- URL : ((* commonconfig .URL )(commonconfig .MustParseURL ("http://localhost:8547" ).URL ())),
87- }},
88- },
89- & solcfg.TOMLConfig {
90- ChainID : & solanaChainID2 ,
65+ Chain : toml .Defaults (evmChainID1 ),
66+ Nodes : toml.EVMNodes {& node1_1 , & node1_2 },
67+ }
68+ id2 := ubig .New (big .NewInt (2 ))
69+ c .EVM = append (c .EVM , & toml.EVMConfig {
70+ ChainID : evmChainID2 ,
71+ Chain : toml .Defaults (id2 ),
9172 Enabled : ptr (true ),
92- Chain : solChainCfg ,
93- Nodes : []* solcfg.Node {{
94- Name : ptr ("solana chain 2 node 1" ),
95- URL : ((* commonconfig .URL )(commonconfig .MustParseURL ("http://localhost:8527" ).URL ())),
96- }},
97- },
98- }
99- })
73+ Nodes : toml.EVMNodes {& node2_1 },
74+ })
75+
76+ c .Solana = solcfg.TOMLConfigs {
77+ & solcfg.TOMLConfig {
78+ ChainID : & solanaChainID1 ,
79+ Enabled : ptr (true ),
80+ Chain : solcfg .NewDefault ().Chain ,
81+ Nodes : []* solcfg.Node {{
82+ Name : ptr ("solana chain 1 node 1" ),
83+ URL : ((* commonconfig .URL )(commonconfig .MustParseURL ("http://localhost:8547" ).URL ())),
84+ }},
85+ },
86+ & solcfg.TOMLConfig {
87+ ChainID : & solanaChainID2 ,
88+ Enabled : ptr (true ),
89+ Chain : solcfg .NewDefault ().Chain ,
90+ Nodes : []* solcfg.Node {{
91+ Name : ptr ("solana chain 2 node 1" ),
92+ URL : ((* commonconfig .URL )(commonconfig .MustParseURL ("http://localhost:8527" ).URL ())),
93+ }},
94+ },
95+ }
96+ })
97+ }
10098
99+ cfg := newConfig ()
101100 db := pgtest .NewSqlxDB (t )
102101 keyStore := cltest .NewKeyStore (t , db )
103102
@@ -163,7 +162,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
163162 {name : "2 solana chain with 2 node" ,
164163 initFuncs : []chainlink.CoreRelayerChainInitFunc {
165164 chainlink .InitSolana (factory , keyStore .Solana (), chainlink.SolanaFactoryConfig {
166- TOMLConfigs : cfg .SolanaConfigs ()}),
165+ TOMLConfigs : newConfig () .SolanaConfigs ()}),
167166 },
168167 expectedSolanaChainCnt : 2 ,
169168 expectedSolanaNodeCnt : 2 ,
@@ -176,7 +175,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
176175
177176 {name : "all chains" ,
178177 initFuncs : []chainlink.CoreRelayerChainInitFunc {chainlink .InitSolana (factory , keyStore .Solana (), chainlink.SolanaFactoryConfig {
179- TOMLConfigs : cfg .SolanaConfigs ()}),
178+ TOMLConfigs : newConfig () .SolanaConfigs ()}),
180179 chainlink .InitEVM (factory , chainlink.EVMFactoryConfig {
181180 ChainOpts : legacyevm.ChainOpts {
182181 ChainConfigs : cfg .EVMConfigs (),
0 commit comments