-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: op-program supports custom chain config (#12310)
* feat: op-program supports custom chain config * address comments * address comments * update mainnet.go/sepolia.go * Update op-program/chainconfig/chaincfg.go Co-authored-by: Adrian Sutton <[email protected]> * more error info on config file not found --------- Co-authored-by: Qi Zhou <[email protected]> Co-authored-by: Adrian Sutton <[email protected]>
- Loading branch information
1 parent
dc12512
commit 527bf6c
Showing
11 changed files
with
15,661 additions
and
32 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
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,29 @@ | ||
package chainconfig | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/ethereum-optimism/optimism/op-program/chainconfig/test" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
// TestGetCustomRollupConfig tests loading the custom rollup configs from test embed FS. | ||
func TestGetCustomRollupConfig(t *testing.T) { | ||
config, err := rollupConfigByChainID(901, test.TestCustomChainConfigFS) | ||
require.NoError(t, err) | ||
require.Equal(t, config.L1ChainID.Uint64(), uint64(900)) | ||
require.Equal(t, config.L2ChainID.Uint64(), uint64(901)) | ||
|
||
_, err = rollupConfigByChainID(900, test.TestCustomChainConfigFS) | ||
require.Error(t, err) | ||
} | ||
|
||
// TestGetCustomChainConfig tests loading the custom chain configs from test embed FS. | ||
func TestGetCustomChainConfig(t *testing.T) { | ||
config, err := chainConfigByChainID(901, test.TestCustomChainConfigFS) | ||
require.NoError(t, err) | ||
require.Equal(t, config.ChainID.Uint64(), uint64(901)) | ||
|
||
_, err = chainConfigByChainID(900, test.TestCustomChainConfigFS) | ||
require.Error(t, err) | ||
} |
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 @@ | ||
{} |
Oops, something went wrong.