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

fix: update vesting message server to handle base accounts correctly #12190

Merged
merged 13 commits into from
Jun 14, 2022

Conversation

alexanderbez
Copy link
Contributor

Description

Extends #12154 to apply to all message types.

closes: #12189


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)

@alexanderbez alexanderbez requested a review from a team as a code owner June 8, 2022 14:09
@alexanderbez alexanderbez added backport/0.45.x backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release labels Jun 8, 2022
@alexanderbez
Copy link
Contributor Author

Actually I don't think this can be backported to 0.45 because it's state machine breaking, right? Same would apply for #12154

x/auth/vesting/msg_server.go Outdated Show resolved Hide resolved
x/auth/vesting/msg_server.go Outdated Show resolved Hide resolved
@alexanderbez alexanderbez added the A:automerge Automatically merge PR once all prerequisites pass. label Jun 9, 2022
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #12190 (476f904) into main (df41b65) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12190   +/-   ##
=======================================
  Coverage   66.15%   66.15%           
=======================================
  Files         673      673           
  Lines       71085    71085           
=======================================
+ Hits        47024    47025    +1     
+ Misses      21418    21417    -1     
  Partials     2643     2643           
Impacted Files Coverage Δ
crypto/keys/internal/ecdsa/privkey.go 83.01% <0.00%> (+1.88%) ⬆️

Copy link
Member

@facundomedica facundomedica left a comment

Choose a reason for hiding this comment

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

utACK

}

baseAccount := authtypes.NewBaseAccountWithAddress(to)
baseAccount = ak.NewAccount(ctx, baseAccount).(*authtypes.BaseAccount)
Copy link
Member

Choose a reason for hiding this comment

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

Are we ok with not checking if the type cast went ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We know that NewBaseAccountWithAddress will return a &BaseAccount. I suppose we could add an explicit check :)

I will do that

Copy link
Member

Choose a reason for hiding this comment

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

There are a couple more of these, so let's add it to all of them for good measure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually there is no need to type check. It just creates more boilerplate IMO. We create a concrete BaseAccount and then we pass it to NewAccount, which just returns what we pass in.

@alexanderbez alexanderbez merged commit fd19210 into main Jun 14, 2022
@alexanderbez alexanderbez deleted the bez/12189-vesting-base-fix branch June 14, 2022 14:43
mergify bot pushed a commit that referenced this pull request Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release C:x/auth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vesting account creation fails if the proto account type is not a BaseAccount
5 participants