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 tokens to lock keeper function #409

Merged
merged 4 commits into from
Aug 12, 2021
Merged

Add tokens to lock keeper function #409

merged 4 commits into from
Aug 12, 2021

Conversation

antstalepresh
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2021

Codecov Report

Merging #409 (321de73) into main (b0c323c) will increase coverage by 0.05%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
x/lockup/keeper/lock.go 75.72% <75.00%> (-0.49%) ⬇️

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 b0c323c...321de73. Read the comment docs.

@@ -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) {
Copy link
Member

@ValarDragon ValarDragon Aug 12, 2021

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.

Copy link
Contributor Author

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

Copy link
Member

@ValarDragon ValarDragon left a 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

@ValarDragon ValarDragon merged commit d9e2772 into main Aug 12, 2021
@ValarDragon ValarDragon deleted the add_tokens_to_lock branch August 12, 2021 14:50
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.

3 participants