-
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
Add tokens to lock keeper function #409
Conversation
Codecov Report
@@ Coverage Diff @@
## main #409 +/- ##
==========================================
+ Coverage 18.42% 18.47% +0.05%
==========================================
Files 142 142
Lines 22002 22023 +21
==========================================
+ Hits 4053 4068 +15
- Misses 17269 17272 +3
- Partials 680 683 +3
Continue to review full report at Codecov.
|
x/lockup/keeper/lock.go
Outdated
@@ -281,6 +281,40 @@ func (k Keeper) UnlockPeriodLockByID(ctx sdk.Context, LockID uint64) (*types.Per | |||
return lock, err | |||
} | |||
|
|||
// AddTokensToLock locks more tokens into a lockup | |||
func (k Keeper) AddTokensToLock(ctx sdk.Context, owner sdk.AccAddress, lockID uint64, coins sdk.Coins) (*types.PeriodLock, error) { |
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.
Can we separate this out into two functions:
AddTokensToLockID(ctx sdk.Context, owner sdk.AccAddress, lockID uint64, coins sdk.Coins)
and
addTokensToLock(ctx, lock *types.PeriodLock, coins sdk.Coins)
I think both will come in handy. The latter doesn't need to publicly exposed, but just separated so it can be called separately.
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.
Did split the function into two pieces
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.
LGTM, just some minor comments
Co-authored-by: Dev Ojha <[email protected]>
…into add_tokens_to_lock
No description provided.