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

Deprecate SetFullFundraiserPath in favor of SetPurpose and SetCoinType #8629

Merged
merged 13 commits into from
Feb 22, 2021
Merged

Deprecate SetFullFundraiserPath in favor of SetPurpose and SetCoinType #8629

merged 13 commits into from
Feb 22, 2021

Conversation

RiccardoM
Copy link
Contributor

@RiccardoM RiccardoM commented Feb 18, 2021

Description

This PR removes the SetFullFundraiserPath method in favor of distinct SetPurpose and SetCoinType methods. It also renames the GetFullFundraiserPath method to GetFullBip44Path.

This is done in order to simplify the code that chains should write when using a custom coin type. Right now, they must call two distinct methods:

cfg.SetCoinType(customCoinType)
cfg.SetFullFundraiserPath(customPath)

With this PR, it would be simplified to

cfg.SetCoinType(customCoinType)

This because the BIP-44 path is now generated considering the data put inside the sdk.Config object instead of taking the full path from outside.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • 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
  • Review Codecov Report in the comment section below once CI passes

…ype and renamed GetFullFundraiserPath to GetFullBip44Path
@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #8629 (c25205e) into master (0b3af0e) will increase coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8629   +/-   ##
=======================================
  Coverage   61.47%   61.47%           
=======================================
  Files         659      659           
  Lines       37876    37881    +5     
=======================================
+ Hits        23283    23287    +4     
- Misses      12159    12160    +1     
  Partials     2434     2434           
Impacted Files Coverage Δ
types/address.go 65.99% <ø> (ø)
x/authz/types/authorization_grant.go 0.00% <ø> (ø)
x/staking/types/authz.go 87.87% <ø> (ø)
types/config.go 84.28% <88.88%> (-0.33%) ⬇️

Copy link
Collaborator

@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.

ACK. Please add an API breaking change Changelog entry

@fedekunze fedekunze added the T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). label Feb 20, 2021
@RiccardoM
Copy link
Contributor Author

ACK. Please add an API breaking change Changelog entry

Added

Copy link
Contributor

@alessio alessio left a comment

Choose a reason for hiding this comment

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

Instead of removing SetFullFundraiserPath() and GetFullFundraiserPath(), I'd like to see both functions being marked as deprecated. We'll remove them in a future release. An example of a deprecation comment follows:

// ModTime returns the modification time in UTC using the legacy
// ModifiedDate and ModifiedTime fields.
//
// Deprecated: Use Modified instead.
func (h *FileHeader) ModTime() time.Time {
	return msDosTimeToTime(h.ModifiedDate, h.ModifiedTime)
}

@RiccardoM
Copy link
Contributor Author

Instead of removing SetFullFundraiserPath() and GetFullFundraiserPath(), I'd like to see both functions being marked as deprecated.

Done 👍

client/keys/export_test.go Outdated Show resolved Hide resolved
types/config.go Outdated Show resolved Hide resolved
types/config_test.go Outdated Show resolved Hide resolved
types/config.go Outdated Show resolved Hide resolved
client/keys/delete_test.go Outdated Show resolved Hide resolved
client/keys/list_test.go Outdated Show resolved Hide resolved
types/address.go Outdated Show resolved Hide resolved
types/config.go Outdated Show resolved Hide resolved
RiccardoM and others added 4 commits February 22, 2021 12:59
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
@RiccardoM RiccardoM requested a review from alessio February 22, 2021 12:03
CHANGELOG.md Outdated Show resolved Hide resolved
@RiccardoM RiccardoM changed the title Removed the SetFullFundraiserPath in favor of SetPurpose and SetCoinType Deprecate SetFullFundraiserPath in favor of SetPurpose and SetCoinType Feb 22, 2021
@RiccardoM RiccardoM requested a review from alessio February 22, 2021 12:33
@alessio alessio merged commit f49e155 into cosmos:master Feb 22, 2021
@RiccardoM RiccardoM deleted the remove-set-full-fundraiser-path branch April 29, 2021 13:03
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).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants