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 msg for permanent locked vesting accounts #11019

Merged
merged 6 commits into from
Jan 29, 2022

Conversation

clevinson
Copy link
Contributor

Description

Closes: #11016


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)

@github-actions github-actions bot added C:orm and removed C:x/gov labels Jan 24, 2022
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK.

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

utACK

@@ -56,6 +56,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#10507](https://github.com/cosmos/cosmos-sdk/pull/10507) Add middleware for tx priority.
* [\#10311](https://github.com/cosmos/cosmos-sdk/pull/10311) Adds cli to use tips transactions. It adds an `--aux` flag to all CLI tx commands to generate the aux signer data (with optional tip), and a new `tx aux-to-fee` subcommand to let the fee payer gather aux signer data and broadcast the tx
* [\#10430](https://github.com/cosmos/cosmos-sdk/pull/10430) ADR-040: Add store/v2 `MultiStore` implementation
* [\#11019](https://github.com/cosmos/cosmos-sdk/pull/11019) Add `MsgCreatePermanentLockedAccount` and CLI method for creating permanent locked account
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also add a state-machine breaking one

@codecov
Copy link

codecov bot commented Jan 25, 2022

Codecov Report

Merging #11019 (6abd6f9) into master (3a1027c) will increase coverage by 0.02%.
The diff coverage is 71.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11019      +/-   ##
==========================================
+ Coverage   65.86%   65.89%   +0.02%     
==========================================
  Files         644      677      +33     
  Lines       65630    68131    +2501     
==========================================
+ Hits        43229    44895    +1666     
- Misses      19920    20527     +607     
- Partials     2481     2709     +228     
Impacted Files Coverage Δ
orm/encoding/ormkv/key_codec.go 82.53% <0.00%> (ø)
orm/model/ormtable/index_impl.go 48.97% <ø> (ø)
orm/model/ormtable/primary_key.go 51.21% <ø> (ø)
orm/model/ormtable/unique.go 36.15% <ø> (ø)
server/config/config.go 40.31% <0.00%> (-0.32%) ⬇️
x/auth/vesting/types/msgs.go 0.00% <0.00%> (ø)
orm/model/ormtable/table_impl.go 53.33% <42.85%> (ø)
orm/internal/fieldnames/fieldnames.go 100.00% <100.00%> (ø)
orm/model/ormtable/build.go 77.43% <100.00%> (ø)
x/auth/vesting/client/testutil/suite.go 96.79% <100.00%> (+1.96%) ⬆️
... and 34 more

Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

utACK, left few suggestions

Comment on lines 199 to 201
if err != nil {
s.T().Fatalf("Getting initial latest height: %v", err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if err != nil {
s.T().Fatalf("Getting initial latest height: %v", err)
}
s.Require().NoError(err, "Getting initial latest height")

next, err := s.network.WaitForHeight(height + 1)
if err != nil {
s.T().Fatalf("Waiting for height %d: %v", height+1, err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

as above, let's use require

// ValidateBasic Implements Msg.
func (msg MsgCreatePermanentLockedAccount) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(msg.FromAddress); err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address: %s", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address: %s", err)
return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err)

Copy link
Collaborator

Choose a reason for hiding this comment

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

similarly below

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot removed the C:orm label Jan 28, 2022
@clevinson clevinson merged commit ea30578 into master Jan 29, 2022
@clevinson clevinson deleted the clevinson/perm-locked-accounts branch January 29, 2022 00:55
@@ -18,6 +18,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount", nil)
cdc.RegisterConcrete(&PeriodicVestingAccount{}, "cosmos-sdk/PeriodicVestingAccount", nil)
cdc.RegisterConcrete(&PermanentLockedAccount{}, "cosmos-sdk/PermanentLockedAccount", nil)
cdc.RegisterConcrete(&MsgCreateVestingAccount{}, "cosmos-sdk/MsgCreateVestingAccount", nil)
Copy link
Member

Choose a reason for hiding this comment

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

Does this line mean there is no Amino JSON signing support for MsgCreateVestingAccount in 0.44 and 0.45?

Copy link
Contributor

@amaury1093 amaury1093 Apr 7, 2022

Choose a reason for hiding this comment

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

hmm, I think it would still work in 0.44 and 0.45, but be shown without the type and value fields, similarly to cosmos/cosmjs#1026 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for permanent locked vesting accounts
8 participants