Skip to content

Commit

Permalink
init test: call Validate on StylusTargetConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
magicxyyz committed Aug 28, 2024
1 parent 7b4834f commit 99b34b3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cmd/nitro/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ func TestEmptyDatabaseDir(t *testing.T) {
}
}

func defaultStylusTargetConfigForTest(t *testing.T) *gethexec.StylusTargetConfig {
targetConfig := gethexec.DefaultStylusTargetConfig
Require(t, targetConfig.Validate())
return &targetConfig
}

func TestOpenInitializeChainDbIncompatibleStateScheme(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -377,7 +383,7 @@ func TestOpenInitializeChainDbIncompatibleStateScheme(t *testing.T) {
&nodeConfig,
new(big.Int).SetUint64(nodeConfig.Chain.ID),
gethexec.DefaultCacheConfigFor(stack, &nodeConfig.Execution.Caching),
&gethexec.DefaultStylusTargetConfig,
defaultStylusTargetConfigForTest(t),
&nodeConfig.Persistent,
l1Client,
chaininfo.RollupAddresses{},
Expand All @@ -394,7 +400,7 @@ func TestOpenInitializeChainDbIncompatibleStateScheme(t *testing.T) {
&nodeConfig,
new(big.Int).SetUint64(nodeConfig.Chain.ID),
gethexec.DefaultCacheConfigFor(stack, &nodeConfig.Execution.Caching),
&gethexec.DefaultStylusTargetConfig,
defaultStylusTargetConfigForTest(t),
&nodeConfig.Persistent,
l1Client,
chaininfo.RollupAddresses{},
Expand All @@ -412,7 +418,7 @@ func TestOpenInitializeChainDbIncompatibleStateScheme(t *testing.T) {
&nodeConfig,
new(big.Int).SetUint64(nodeConfig.Chain.ID),
gethexec.DefaultCacheConfigFor(stack, &nodeConfig.Execution.Caching),
&gethexec.DefaultStylusTargetConfig,
defaultStylusTargetConfigForTest(t),
&nodeConfig.Persistent,
l1Client,
chaininfo.RollupAddresses{},
Expand Down Expand Up @@ -548,7 +554,7 @@ func TestOpenInitializeChainDbEmptyInit(t *testing.T) {
&nodeConfig,
new(big.Int).SetUint64(nodeConfig.Chain.ID),
gethexec.DefaultCacheConfigFor(stack, &nodeConfig.Execution.Caching),
&gethexec.DefaultStylusTargetConfig,
defaultStylusTargetConfigForTest(t),
&nodeConfig.Persistent,
l1Client,
chaininfo.RollupAddresses{},
Expand Down

0 comments on commit 99b34b3

Please sign in to comment.