-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Fix export segfault #2128
Fix export segfault #2128
Conversation
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.
utACK -- looks great @mslipper, just left a remark or two 👍
server/export.go
Outdated
} | ||
|
||
if emptyState { | ||
fmt.Println("WARNING: State is not initialized. Returning genesis.json.") |
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.
Returning genesis file.
I think might sound a bit better?
@@ -43,3 +60,12 @@ func ExportCmd(ctx *Context, cdc *wire.Codec, appExporter AppExporter) *cobra.Co | |||
}, | |||
} | |||
} | |||
|
|||
func isEmptyState(home string) (bool, error) { |
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.
@ValarDragon is this sanity check enough or is there a more direct method we can perform via some attempted state lookup?
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.
Seems fine to me since we ensure all file writes persist to disk. I think we can merge this, and then write an issue to query state directly later. (#postlaunch concern)
server/export_test.go
Outdated
os.Stdout = old | ||
out := <-outC | ||
require.Contains(t, out, "WARNING: State is not initialized") | ||
require.Contains(t, out, "consensus_params") |
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.
Should we check for other top level keys?
Also let's merge |
Codecov Report
@@ Coverage Diff @@
## develop #2128 +/- ##
===========================================
+ Coverage 63.85% 63.91% +0.05%
===========================================
Files 134 134
Lines 8175 8194 +19
===========================================
+ Hits 5220 5237 +17
+ Misses 2605 2604 -1
- Partials 350 353 +3 |
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.
utACK, thanks.
In the future, please don't continuously squash commits - we can do that when we merge (the checklist is confusing, sorry...)
Closes #1834
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: