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

Add upgrade v3 to update endtime for validator vesting accounts #439

Merged
merged 5 commits into from
Sep 27, 2022

Conversation

pinosu
Copy link
Contributor

@pinosu pinosu commented Aug 11, 2022

Resolves #420

@codecov-commenter
Copy link

Codecov Report

Merging #439 (fb7f56a) into main (7916c09) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #439   +/-   ##
=======================================
  Coverage   56.88%   56.88%           
=======================================
  Files          74       74           
  Lines        5805     5806    +1     
=======================================
+ Hits         3302     3303    +1     
  Misses       2181     2181           
  Partials      322      322           
Impacted Files Coverage Δ
app/app.go 87.59% <100.00%> (+0.03%) ⬆️

@pinosu pinosu requested a review from alpe August 22, 2022 15:12
return nil, err
}
ak.GetAccount(ctx, accAddr)
// TODO set endtime for vesting account
Copy link
Contributor

Choose a reason for hiding this comment

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

You would need to cast to *vestingtypes.ContinuousVestingAccount to access the field, apply some safety checks and then update the data via ak.SetAccount

newEndTime int64 = 1688220000
)

var addresses = []string{
Copy link
Contributor

Choose a reason for hiding this comment

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

These accounts do not exists on mainnet and will break the migration:
tgrade1ukqqgpftlmwf2ylkvfj467e6wynef05lqcrtjn
tgrade19g64psls2eqwd34nu03c2pcc45jptzxpmwmzu9

@pinosu pinosu force-pushed the 420-upgrade_end_time_validators branch from f8b7894 to dc367e1 Compare September 22, 2022 10:36
@pinosu pinosu marked this pull request as ready for review September 22, 2022 11:15
Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@alpe alpe mentioned this pull request Sep 27, 2022
@pinosu pinosu merged commit 3fa59ca into main Sep 27, 2022
pinosu added a commit that referenced this pull request Oct 17, 2022
* Add upgrade v3 to update endtime for validator vesting accounts

* Add addresses

* Add logic for updating end time for vesting account

* Migration test example (#454)

* Assert end time to be update correctly

Co-authored-by: Alexander Peters <alpe@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change end_time on all vesting accounts for validators only
3 participants