Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

init: add random chain-id generator #797

Merged
merged 3 commits into from
Feb 26, 2021
Merged

Conversation

helder-moreira
Copy link

Closes: #681

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@helder-moreira helder-moreira force-pushed the helder/chain-id-generator branch from eb2c80f to 8f0ed03 Compare February 15, 2021 15:18
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

Minor comment

types/chain_id.go Outdated Show resolved Hide resolved
Comment on lines +75 to +77
if chainID == "" {
viper.Set(flags.FlagChainID, ethermint.GenerateRandomChainID())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to add this logic to the ValidateChainID function

Copy link
Contributor

Choose a reason for hiding this comment

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

But then ValidateChainID would not just validate

@mergify mergify bot merged commit 99112e1 into development Feb 26, 2021
@mergify mergify bot deleted the helder/chain-id-generator branch February 26, 2021 15:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It returns error when "--chain-id" was set empty during "ethermintd init"
3 participants