-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f21eab2
commit 2cc818c
Showing
3 changed files
with
64 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package chain | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetContractAddressesByChainID(t *testing.T) { | ||
const availableChainID uint64 = 10 | ||
|
||
var contractAddresses = GetContractAddressesByChainID(availableChainID) | ||
|
||
var ContractAddressesExpected = map[string]L1Contracts{ | ||
"l1": { | ||
stateCommitmentChain: "0xBe5dAb4A2e9cd0F27300dB4aB94BeE3A233AEB19", | ||
optimismPortal: "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed", | ||
l2OutputOracle: "0xdfe97868233d1aa22e815a266982f2cf17685a27", | ||
}} | ||
|
||
assert.Equal(t, ContractAddressesExpected, contractAddresses) | ||
|
||
const unavailableChainID uint64 = 5 | ||
|
||
contractAddresses = GetContractAddressesByChainID(unavailableChainID) | ||
assert.Equal(t, 0, len(contractAddresses)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package chain |