Skip to content

Commit

Permalink
Allow --eth-node to be used on integration (#1473)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshklop authored Nov 27, 2023
1 parent 625ccfa commit a6b8453
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion utils/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (n Network) CoreContractAddress() (common.Address, error) {
case Goerli2:
address = common.HexToAddress("0xa4eD3aD27c294565cB0DCc993BDdCC75432D498c")
case Integration:
return common.Address{}, errors.New("l1 contract is not available on the integration network")
address = common.HexToAddress("0xd5c325D183C592C94998000C5e0EED9e6655c020")
case Sepolia:
return common.HexToAddress("0xE2Bb56ee936fd6433DC0F6e7e3b8365C906AA057"), nil
case SepoliaIntegration:
Expand Down
21 changes: 8 additions & 13 deletions utils/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,18 @@ func TestNetworkType(t *testing.T) {

func TestCoreContractAddress(t *testing.T) {
addresses := map[utils.Network]common.Address{
utils.Mainnet: common.HexToAddress("0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4"),
utils.Goerli: common.HexToAddress("0xde29d060D45901Fb19ED6C6e959EB22d8626708e"),
utils.Goerli2: common.HexToAddress("0xa4eD3aD27c294565cB0DCc993BDdCC75432D498c"),
utils.Mainnet: common.HexToAddress("0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4"),
utils.Goerli: common.HexToAddress("0xde29d060D45901Fb19ED6C6e959EB22d8626708e"),
utils.Goerli2: common.HexToAddress("0xa4eD3aD27c294565cB0DCc993BDdCC75432D498c"),
utils.Integration: common.HexToAddress("0xd5c325D183C592C94998000C5e0EED9e6655c020"),
}

for n := range networkStrings {
t.Run("core contract for "+n.String(), func(t *testing.T) {
switch n {
case utils.Integration:
_, err := n.CoreContractAddress()
require.Error(t, err)
default:
got, err := n.CoreContractAddress()
require.NoError(t, err)
want := addresses[n]
assert.Equal(t, want, got)
}
got, err := n.CoreContractAddress()
require.NoError(t, err)
want := addresses[n]
assert.Equal(t, want, got)
})
}
}

0 comments on commit a6b8453

Please sign in to comment.