-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix: Tier module fixes and improvements (part 4) #13
Conversation
…nd query.proto messages; run proto-go
…enesis, update tests
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #13 +/- ##
==========================================
+ Coverage 28.53% 29.27% +0.74%
==========================================
Files 148 148
Lines 6225 6233 +8
==========================================
+ Hits 1776 1825 +49
+ Misses 4336 4298 -38
+ Partials 113 110 -3 ☔ View full report in Codecov by Sentry. |
…nticalUnlockingLockups
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, I don't fully understand the credit calculations atm but overall the code looks good and the changes make sense after your code walkthrough. Good job Ivan, will review the remaining PRs tomorrow.
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.
Really great work here. Like the proper separation between Lockup and UnlockingLockup state (albeit the names are a little confusing, understandably).
Have a few questions, but nothing that is a blocker, and one suggestion that is up to you.
if sinceCurrentEpoch < epochDurationMs { | ||
credit = credit.MulRaw(sinceCurrentEpoch).QuoRaw(epochDurationMs) | ||
} |
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.
praise: nice catch
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.
question/future refactor.
We might want to be more aware of what functions are public/private on the Keeper, or more accurately what functions need to be public.
Reading through some of these Add/Subtract methods makes me feel like they are mostly necessary for the internal functionality to the keeper. Compared to the possibility of another dev using these unnecessarily or accidentally from a different package.
Just a thought. Dont need to be updated in this PR
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.
Agree, we should be more accurate on what needs to be public. Will make these changes in the upcoming PR. Thank you
// LockupKeyToAddressesAtHeight retreives delAddr, valAddr, and creationHeight from provided unlocking Lockup key. | ||
func LockupKeyToAddressesAtHeight(key []byte) (sdk.AccAddress, sdk.ValAddress, int64) { |
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.
suggestion: Are the LockupKeyToAddressesAtHeight
not still handy util functions to have around?
Description
This PR aims to add a number of fixes and additional improvements on top of work done in #10
Tasks
UnlockingLockup
, refactorLockup
,GenesisState
, and query messages.unbondTime
tocompletionTime
to match native staking module.creation_height
toMsgUnlockResponse
.GenesisState
.calculateProratedCredit
.completionTime
/unlockTime
edge case inCompleteUnlocking
.proratedCredit
, addTestCalculateProratedCredit
andTestProratedCredit
.