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

Vesting account creation fails if the proto account type is not a BaseAccount #12189

Closed
4 tasks
fedekunze opened this issue Jun 8, 2022 · 1 comment · Fixed by #12190
Closed
4 tasks

Vesting account creation fails if the proto account type is not a BaseAccount #12189

fedekunze opened this issue Jun 8, 2022 · 1 comment · Fixed by #12190
Labels

Comments

@fedekunze
Copy link
Collaborator

Summary of Bug

This line fails if the proto base account defined in the application is not a BaseAccount:

https://github.com/cosmos/cosmos-sdk/blob/main/x/auth/vesting/msg_server.go#L138-L143

Needs to be changed to

	baseAcc := authtypes.NewBaseAccountWithAddress(to)
	lockedAcc := sdkvesting.NewPermanentLockedAccount(baseAcc, msg.Amount) // or other vesting account type
	// set the new account sequence
	acc := ak.NewAccount(ctx, lockedAcc)
	ak.SetAccount(ctx, acc)

Version

main, latest (v0.46 rcs and < v0.45)

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

@fedekunze See a relevant PR that was recently made by the CRO team: #12154

We should probably adopt this for all the handlers, no?

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 a pull request may close this issue.

2 participants