Skip to content

Commit 3e9d26f

Browse files
committed
feat: run l1 node page
1 parent 5f94c9c commit 3e9d26f

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ endif
2525

2626
$(BUILDDIR)/:
2727
mkdir -p $(BUILDDIR)/
28+
29+
test: build
30+
./weave

models/homepage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (m *Homepage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
3737
if selected != nil {
3838
switch *selected {
3939
case InitOption:
40-
return weaveinit.NewWeaveInit(&weaveinit.State{}), nil
40+
return weaveinit.NewWeaveInit(), nil
4141
}
4242
}
4343

models/weaveinit/run_l1_node.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88

99
type RunL1Node struct {
1010
utils.TextInput
11-
state *State
11+
state *RunL1NodeState
1212
}
1313

14-
func NewRunL1Node(state *State) *RunL1Node {
14+
func NewRunL1Node(state *RunL1NodeState) *RunL1Node {
1515
return &RunL1Node{
1616
TextInput: "",
1717
state: state,
@@ -34,5 +34,5 @@ func (m *RunL1Node) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
3434
}
3535

3636
func (m *RunL1Node) View() string {
37-
return fmt.Sprintf("? Please set up a Gas Station account\n %s\n", m.TextInput)
37+
return fmt.Sprintf("? Please set up a Gas Station account (The account that will hold the funds required by the OPinit-bots or relayer to send transactions)\nYou can also set this up later. Weave will not send any transactions without your confirmation.\n> %s\n", m.TextInput)
3838
}

models/weaveinit/state.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package weaveinit
22

3-
type State struct {
4-
vm string
3+
type RunL1NodeState struct {
54
gasStationMnemonic string
65
}

models/weaveinit/weaveinit.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77

88
type WeaveInit struct {
99
utils.Selector[WeaveInitOption]
10-
state *State
1110
}
1211

1312
type WeaveInitOption string
@@ -19,7 +18,7 @@ const (
1918
StartRelayerOption WeaveInitOption = "Start a Relayer"
2019
)
2120

22-
func NewWeaveInit(state *State) *WeaveInit {
21+
func NewWeaveInit() *WeaveInit {
2322
return &WeaveInit{
2423
Selector: utils.Selector[WeaveInitOption]{
2524
Options: []WeaveInitOption{
@@ -30,7 +29,6 @@ func NewWeaveInit(state *State) *WeaveInit {
3029
},
3130
Cursor: 0,
3231
},
33-
state: state,
3432
}
3533
}
3634

@@ -43,7 +41,7 @@ func (m *WeaveInit) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
4341
if selected != nil {
4442
switch *selected {
4543
case RunL1NodeOption:
46-
return NewRunL1Node(&State{}), nil
44+
return NewRunL1Node(&RunL1NodeState{}), nil
4745
}
4846
}
4947

0 commit comments

Comments
 (0)