-
Notifications
You must be signed in to change notification settings - Fork 607
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
Conversation
It might help, the old PR #543 has partial unlocking implemented that you can reference to! |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. |
@@ -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 { |
There was a problem hiding this comment.
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!
locked = suite.app.LockupKeeper.GetAccountLockedCoins(suite.ctx, addr1) | ||
suite.Require().Equal(len(locked), 1) | ||
suite.Require().Equal(locked[0].Amount.Int64(), int64(10)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
Co-authored-by: Dev Ojha <[email protected]>
* 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]>
TODO
Description
For contributor use:
docs/
) or specification (x/<module>/spec/
)Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer