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

Partial unlocking implementation #893

Merged
merged 5 commits into from
Feb 19, 2022
Merged

Partial unlocking implementation #893

merged 5 commits into from
Feb 19, 2022

Conversation

mconcat
Copy link
Collaborator

@mconcat mconcat commented Feb 17, 2022

TODO

  • logic impl
  • testing

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@mattverse
Copy link
Member

It might help, the old PR #543 has partial unlocking implemented that you can reference to!

@mconcat mconcat marked this pull request as ready for review February 18, 2022 06:56
@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2022

Codecov Report

Merging #893 (583e912) into main (b990199) will increase coverage by 1.30%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #893      +/-   ##
==========================================
+ Coverage   20.38%   21.69%   +1.30%     
==========================================
  Files         192      192              
  Lines       24783    25626     +843     
==========================================
+ Hits         5053     5559     +506     
- Misses      18798    19065     +267     
- Partials      932     1002      +70     
Impacted Files Coverage Δ
x/lockup/keeper/msg_server.go 26.08% <0.00%> (ø)
x/lockup/keeper/lock.go 62.34% <81.81%> (+9.04%) ⬆️
x/lockup/client/cli/tx.go 63.01% <100.00%> (+0.51%) ⬆️
x/lockup/keeper/iterator.go 82.50% <100.00%> (ø)
x/lockup/keeper/synthetic_lock.go 76.47% <100.00%> (+1.47%) ⬆️
x/superfluid/keeper/hooks.go 55.10% <0.00%> (-1.15%) ⬇️
x/lockup/keeper/grpc_query.go 74.74% <0.00%> (-0.57%) ⬇️
x/superfluid/keeper/distribution.go 87.50% <0.00%> (+1.78%) ⬆️
x/gamm/pool-models/balancer/balancerPool.pb.go 17.60% <0.00%> (+2.86%) ⬆️
x/incentives/keeper/distribute.go 76.59% <0.00%> (+3.26%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b990199...583e912. Read the comment docs.

@@ -59,9 +60,17 @@ func (k Keeper) GetAllSyntheticLockupsByLockup(ctx sdk.Context, lockID uint64) [
return synthLocks
}

func (k Keeper) HasAnySyntheticLockups(ctx sdk.Context, lockID uint64) bool {
Copy link
Member

Choose a reason for hiding this comment

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

Nice, this is a good fn to have!

Comment on lines +244 to +246
locked = suite.app.LockupKeeper.GetAccountLockedCoins(suite.ctx, addr1)
suite.Require().Equal(len(locked), 1)
suite.Require().Equal(locked[0].Amount.Int64(), int64(10))
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this by 9?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

GetAccountLockedCoins returns all coins that is qualified for reward, so it includes unlocking coins. Will add logic for checking 9 case!

@ValarDragon ValarDragon merged commit debeb29 into main Feb 19, 2022
@ValarDragon ValarDragon deleted the mconcat/partial-unlock branch February 19, 2022 07:19
UnityChaos pushed a commit that referenced this pull request Feb 20, 2022
* add partial unlock logic

* add partial unlock test

* fix lint

* Apply suggestions from code review

Co-authored-by: Dev Ojha <[email protected]>

* add test for case after unlocking period

Co-authored-by: Dev Ojha <[email protected]>
@github-actions github-actions bot mentioned this pull request Mar 15, 2024
@github-actions github-actions bot mentioned this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants