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

Replace Redundant Bech32 PubKey Functions #5495

Merged
merged 7 commits into from
Jan 9, 2020
Merged

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Jan 8, 2020

There is no need for a (Must)Bech32ify* and (Must)Get*KeyBech32 set of functions for each Bech32 prefix/type. Replace them with a single pair of flexible functions that accept a Bech32PubKeyType. To support new Bech32 prefixes, just add/use a new Bech32PubKeyType variable/const.


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)

@alexanderbez alexanderbez added WIP T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. labels Jan 8, 2020
@alexanderbez alexanderbez marked this pull request as ready for review January 8, 2020 20:27
@alexanderbez alexanderbez added R4R and removed WIP labels Jan 8, 2020
@codecov
Copy link

codecov bot commented Jan 8, 2020

Codecov Report

Merging #5495 into master will increase coverage by <.01%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5495      +/-   ##
=========================================
+ Coverage    54.5%   54.5%   +<.01%     
=========================================
  Files         313     313              
  Lines       18910   18880      -30     
=========================================
- Hits        10307   10291      -16     
+ Misses       7811    7805       -6     
+ Partials      792     784       -8
Impacted Files Coverage Δ
client/keys/add.go 41.13% <0%> (ø) ⬆️
types/address.go 62.31% <100%> (+1.53%) ⬆️
x/auth/types/stdtx.go 61.53% <100%> (ø) ⬆️
x/auth/vesting/types/vesting_account.go 86.64% <100%> (ø) ⬆️
x/auth/types/account.go 84.44% <100%> (ø) ⬆️
x/staking/types/msg.go 55.55% <33.33%> (ø) ⬆️
crypto/keys/output.go 58.13% <50%> (ø) ⬆️
x/staking/client/cli/tx.go 11.83% <50%> (ø) ⬆️
x/staking/types/validator.go 63.77% <75%> (ø) ⬆️
x/mock/app.go 62.83% <0%> (-1.36%) ⬇️

client/debug/main.go Outdated Show resolved Hide resolved
@alexanderbez alexanderbez merged commit 869531c into master Jan 9, 2020
@alexanderbez alexanderbez deleted the bez/bech32-code-dry branch January 9, 2020 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants