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 Hook for Extend Lockup Duration #1405

Merged
merged 4 commits into from
May 5, 2022
Merged

Conversation

mconcat
Copy link
Collaborator

@mconcat mconcat commented May 4, 2022

Closes: #1404

What is the purpose of the change

*Add a description of the overall background and high level changes that this PR introduces *

(E.g.: This pull request improves documation of area A by adding ....

Brief change log

(for example:)

  • The metadata is stored in the blob store on job creation time as a persistent artifact
  • Deployments RPC transmits only the blob storage reference
  • Daemons retrieve the RPC data from the blob cache

Testing and Verifying

(Please pick one of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added unit test that validates ...
  • Added integration tests for end-to-end deployment with ...
  • Extended integration test for ...
  • Manually verified the change by ...

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? (yes / no)
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? (yes / no)
  • How is the feature or change documented? (not applicable / specification (x/<module>/spec/) / Osmosis docs repo / not documented)

@mconcat mconcat requested a review from a team May 4, 2022 09:00
@@ -12,6 +12,7 @@ type LockupHooks interface {
OnStartUnlock(ctx sdk.Context, address sdk.AccAddress, lockID uint64, amount sdk.Coins, lockDuration time.Duration, unlockTime time.Time)
OnTokenUnlocked(ctx sdk.Context, address sdk.AccAddress, lockID uint64, amount sdk.Coins, lockDuration time.Duration, unlockTime time.Time)
OnTokenSlashed(ctx sdk.Context, lockID uint64, amount sdk.Coins)
OnLockupExtend(ctx sdk.Context, address sdk.AccAddress, lockID uint64, amount sdk.Coins, prevDuration time.Duration, newDuration time.Duration, unlockTime time.Time)
Copy link
Member

Choose a reason for hiding this comment

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

Should the API be ctx, lockID, oldDuration ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just put all the fields on the method, if that is sufficient I think it is good(although maybe adding newDuration?)

@codecov-commenter
Copy link

Codecov Report

Merging #1405 (7ac7b8a) into main (f56fbe5) will decrease coverage by 0.28%.
The diff coverage is 17.22%.

@@            Coverage Diff             @@
##             main    #1405      +/-   ##
==========================================
- Coverage   19.82%   19.53%   -0.29%     
==========================================
  Files         202      226      +24     
  Lines       27685    30953    +3268     
==========================================
+ Hits         5489     6048     +559     
- Misses      21175    23800    +2625     
- Partials     1021     1105      +84     
Impacted Files Coverage Δ
x/epochs/client/cli/query.go 0.00% <ø> (ø)
x/gamm/client/cli/query.go 36.74% <0.00%> (-0.36%) ⬇️
x/gamm/pool-models/stableswap/amm.go 40.27% <0.00%> (-15.50%) ⬇️
x/gamm/pool-models/stableswap/msgs.go 0.00% <0.00%> (ø)
x/gamm/pool-models/stableswap/pool.go 0.00% <0.00%> (ø)
x/gamm/pool-models/stableswap/stableswap_pool.go 0.00% <0.00%> (ø)
.../gamm/pool-models/stableswap/stableswap_pool.pb.go 0.58% <0.00%> (-0.09%) ⬇️
x/gamm/types/pool.go 0.00% <ø> (ø)
x/incentives/client/cli/query.go 0.00% <ø> (ø)
x/incentives/keeper/distribute.go 61.00% <0.00%> (ø)
... and 49 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 d812215...7ac7b8a. Read the comment docs.

@ValarDragon ValarDragon merged commit 942466d into main May 5, 2022
@ValarDragon ValarDragon deleted the mconcat/1404-extend-lock-hook branch May 5, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Investigate ExtendLockup hooks
4 participants