Skip to content

Commit 53ba7ee

Browse files
author
YukiTsuchida
committed
fix: retrieve chainID dynamically in NewChain function
1 parent 87add38 commit 53ba7ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/testing/chain_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,16 @@ func NewChain(t *testing.T, rpcAddr string, mnemonicPhrase string, ccfg Contract
172172
if err != nil {
173173
panic(err)
174174
}
175+
id, err := ethc.ChainID(context.Background())
176+
if err != nil {
177+
panic(err)
178+
}
175179
return &Chain{
176180
ETHClient: ethc,
177181
CrossSimpleModule: *crossMod,
178182
ContractConfig: ccfg,
179183

180-
chainID: 5777,
184+
chainID: id.Int64(),
181185
mnemonicPhrase: mnemonicPhrase,
182186
keys: make(map[uint32]*ecdsa.PrivateKey),
183187
}

0 commit comments

Comments
 (0)