Skip to content
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

feat: add --output-document flag to the export CLI command to allow writing genesis state to a file instead of STDOUT #13802

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

jacobhjkim
Copy link

@jacobhjkim jacobhjkim commented Nov 9, 2022

Description

Closes: #13331

Add --output-document flag to the export CLI command to allow writing genesis state to a file.

Added a new flag --output-ducument for simd export.

$ simd export --help
Export state to JSON

Usage:
  simd export [flags]

Flags:
      ...
      --output-document string       Exported state is written to the given file instead of STDOUT

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@jacobhjkim jacobhjkim requested a review from a team as a code owner November 9, 2022 04:42
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I think this feature should be additive.
Like we do for auth cli.

server/export.go Outdated Show resolved Hide resolved
server/export.go Outdated Show resolved Hide resolved
server/export.go Outdated Show resolved Hide resolved
@jacobhjkim jacobhjkim changed the title feat: save exported genesis state to a file instead of printing to the stdout feat: add --output-document flag to the export CLI command to allow writing genesis state to a file instead of STDOUT Nov 9, 2022
…riting genesis state to a file instead of STDOUT
@jacobhjkim
Copy link
Author

Thanks for the PR! I think this feature should be additive. Like we do for auth cli.

@julienrbrt Hi, thanks for the review! Updated the PR accordingly.

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK! Thank you!

forZeroHeight, _ := cmd.Flags().GetBool(FlagForZeroHeight)
jailAllowedAddrs, _ := cmd.Flags().GetStringSlice(FlagJailAllowedAddrs)
modulesToExport, _ := cmd.Flags().GetStringSlice(FlagModulesToExport)
outputDocument, _ := cmd.Flags().GetString(FlagOutputDocument)

Check warning

Code scanning / gosec

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.
@julienrbrt julienrbrt enabled auto-merge (squash) November 9, 2022 07:55
@codecov
Copy link

codecov bot commented Nov 9, 2022

Codecov Report

Merging #13802 (4649e56) into main (f8e40d7) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13802      +/-   ##
==========================================
- Coverage   56.71%   56.70%   -0.02%     
==========================================
  Files         635      635              
  Lines       54547    54547              
==========================================
- Hits        30938    30931       -7     
- Misses      21105    21110       +5     
- Partials     2504     2506       +2     
Impacted Files Coverage Δ
crypto/keys/internal/ecdsa/privkey.go 81.13% <0.00%> (-1.89%) ⬇️
x/staking/simulation/operations.go 74.54% <0.00%> (-1.38%) ⬇️

@julienrbrt julienrbrt merged commit 8bfc3bf into cosmos:main Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(export): genesis.json shows some plain-text logs
2 participants