-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - implement genesis config #3600
Conversation
@@ -296,6 +299,31 @@ func (app *App) introduction() { | |||
|
|||
// Initialize sets up an exit signal, logging and checks the clock, returns error if clock is not in sync. | |||
func (app *App) Initialize() (err error) { | |||
// ensure all data folders exist | |||
err = filesystem.ExistOrCreate(app.Config.DataDir()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for better usability maybe we should just go ahead to create the directory if it doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this function is creating a directory exactly in such case. did i miss your point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol. my bad.
the error msg is "ensure folders exist" which misled me and prolly the operator. but i guess it'll print filesystem error to give the operator more hint.
cmd/node/node_test.go
Outdated
GenesisTime: time.Now().Format(time.RFC3339), | ||
}, | ||
} | ||
require.ErrorContains(t, app.Initialize(), "tortoise") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can start from DefaultTestConfig() and modify the genesis config and data dir so you don't hit the tortoise param error. see TestInitialize_BadTortoiseParams
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, slipped from my mind
cmd/node/node_test.go
Outdated
} | ||
|
||
require.ErrorContains(t, app.Initialize(), "tortoise") | ||
require.ErrorContains(t, app.Initialize(), "tortoise") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double-whammy :P
bors try |
tryBuild succeeded: |
bors merge |
Build failed: |
bors merge |
Pull request successfully merged into develop. Build succeeded: |
closes: #3505