Skip to content

Commit

Permalink
Adds l3Config to NodeBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed Sep 23, 2024
1 parent c1bd83e commit 5852df1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 14 additions & 12 deletions system_tests/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ type NodeBuilder struct {
l1StackConfig *node.Config
l2StackConfig *node.Config
valnodeConfig *valnode.Config
l3Config *NitroConfig
L1Info info
L2Info info
L3Info info
Expand Down Expand Up @@ -289,7 +290,7 @@ func L3NitroConfigDefaultTest(t *testing.T) *NitroConfig {
valnodeConfig := valnode.TestValidationConfig
return &NitroConfig{
chainConfig: chainConfig,
nodeConfig: arbnode.ConfigDefaultL2Test(),
nodeConfig: arbnode.ConfigDefaultL1Test(),
execConfig: ExecConfigDefaultTest(t),
stackConfig: testhelpers.CreateStackConfigForTest(t.TempDir()),
valnodeConfig: &valnodeConfig,
Expand Down Expand Up @@ -322,6 +323,7 @@ func (b *NodeBuilder) DefaultConfig(t *testing.T, withL1 bool) *NodeBuilder {
cp := valnode.TestValidationConfig
b.valnodeConfig = &cp
b.execConfig = ExecConfigDefaultTest(t)
b.l3Config = L3NitroConfigDefaultTest(t)
return b
}

Expand Down Expand Up @@ -479,10 +481,10 @@ func buildOnParentChain(
return chainTestClient
}

func (b *NodeBuilder) BuildL3OnL2(t *testing.T, nitroConfig *NitroConfig) func() {
b.L3Info = NewArbTestInfo(t, nitroConfig.chainConfig.ChainID)
func (b *NodeBuilder) BuildL3OnL2(t *testing.T) func() {
b.L3Info = NewArbTestInfo(t, b.l3Config.chainConfig.ChainID)

locator, err := server_common.NewMachineLocator(nitroConfig.valnodeConfig.Wasm.RootPath)
locator, err := server_common.NewMachineLocator(b.l3Config.valnodeConfig.Wasm.RootPath)
Require(t, err)

parentChainReaderConfig := headerreader.TestConfig
Expand All @@ -493,9 +495,9 @@ func (b *NodeBuilder) BuildL3OnL2(t *testing.T, nitroConfig *NitroConfig) func()
b.L2Info,
b.L2.Client,
&parentChainReaderConfig,
nitroConfig.chainConfig,
b.l3Config.chainConfig,
locator.LatestWasmModuleRoot(),
nitroConfig.withProdConfirmPeriodBlocks,
b.l3Config.withProdConfirmPeriodBlocks,
false,
)

Expand All @@ -509,12 +511,12 @@ func (b *NodeBuilder) BuildL3OnL2(t *testing.T, nitroConfig *NitroConfig) func()
b.L2,
b.chainConfig.ChainID,

nitroConfig.chainConfig,
nitroConfig.stackConfig,
nitroConfig.execConfig,
nitroConfig.nodeConfig,
nitroConfig.valnodeConfig,
nitroConfig.isSequencer,
b.l3Config.chainConfig,
b.l3Config.stackConfig,
b.l3Config.execConfig,
b.l3Config.nodeConfig,
b.l3Config.valnodeConfig,
b.l3Config.isSequencer,
b.L3Info,

initMessage,
Expand Down
4 changes: 1 addition & 3 deletions system_tests/l3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ func TestBasicL3(t *testing.T) {
cleanupL1AndL2 := builder.Build(t)
defer cleanupL1AndL2()

l3NodeNitroConfig := L3NitroConfigDefaultTest(t)
l3NodeNitroConfig.nodeConfig.ParentChainReader.Enable = true
cleanupL3 := builder.BuildL3OnL2(t, l3NodeNitroConfig)
cleanupL3 := builder.BuildL3OnL2(t)
defer cleanupL3()

builder.L3Info.GenerateAccount("User2")
Expand Down

0 comments on commit 5852df1

Please sign in to comment.