Skip to content

Commit 1313d45

Browse files
committed
fix: typo
1 parent dc68151 commit 1313d45

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

models/initia/run_l1_node.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ type ExistingGenesisReplaceOption string
582582

583583
const (
584584
UseCurrentGenesis ExistingGenesisReplaceOption = "Use current one"
585-
ReplaceGenesis ExistingGenesisReplaceOption = "Replace"
585+
ReplaceGenesis ExistingGenesisReplaceOption = "Replace" // TODO: Dynamic text based on Network
586586
)
587587

588588
func NewExistingGenesisReplaceSelect(state *RunL1NodeState) *ExistingGenesisReplaceSelect {
@@ -620,7 +620,7 @@ func (m *ExistingGenesisReplaceSelect) Update(msg tea.Msg) (tea.Model, tea.Cmd)
620620
}
621621
} else {
622622
if *selected == ReplaceGenesis {
623-
m.state.replaceExisitigGenesisWithDefault = true
623+
m.state.replaceExistingGenesisWithDefault = true
624624
}
625625
newLoader := NewInitializingAppLoading(m.state)
626626
return newLoader, newLoader.Init()
@@ -866,7 +866,8 @@ func initializeApp(state *RunL1NodeState) tea.Cmd {
866866
if err = utils.CreateService(utils.GetRunL1NodeServiceName(), utils.GetRunL1NodeServiceContent(state.initiadVersion)); err != nil {
867867
panic(fmt.Sprintf("failed to create service: %v", err))
868868
}
869-
if state.replaceExisitigGenesisWithDefault {
869+
870+
if state.replaceExistingGenesisWithDefault {
870871
// Create a temporary home directory for the Initia node
871872
tmpInitiaHome := filepath.Join(weaveDataPath, "tmp_initia")
872873
if err := os.MkdirAll(tmpInitiaHome, os.ModePerm); err != nil {
@@ -879,15 +880,15 @@ func initializeApp(state *RunL1NodeState) tea.Cmd {
879880
panic(fmt.Sprintf("failed to run temporary initiad init: %v", err))
880881
}
881882

882-
// Move the temporary genesis.json file to the real Initia config path
883+
// Move the temporary genesis.json file to the user Initia config path
883884
tmpGenesisPath := filepath.Join(tmpInitiaHome, "config/genesis.json")
884-
realGenesisPath := filepath.Join(initiaConfigPath, "genesis.json")
885-
if err := os.Rename(tmpGenesisPath, realGenesisPath); err != nil {
885+
userGenesisPath := filepath.Join(initiaConfigPath, "genesis.json")
886+
if err = os.Rename(tmpGenesisPath, userGenesisPath); err != nil {
886887
panic(fmt.Sprintf("failed to move genesis.json: %v", err))
887888
}
888889

889890
// Clean up the temporary Initia directory
890-
if err := os.RemoveAll(tmpInitiaHome); err != nil {
891+
if err = os.RemoveAll(tmpInitiaHome); err != nil {
891892
panic(fmt.Sprintf("failed to remove temporary Initia home directory: %v", err))
892893
}
893894
}

models/initia/state.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type RunL1NodeState struct {
2121
existingData bool
2222
syncMethod string
2323
replaceExistingData bool
24-
replaceExisitigGenesisWithDefault bool
24+
replaceExistingGenesisWithDefault bool
2525
snapshotEndpoint string
2626
stateSyncEndpoint string
2727
}

0 commit comments

Comments
 (0)