-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Tier module fixes and improvements (part 2) (#8)
* Add creation_height to UnlockingLockupRequest message * Generate proto * Add CreateValidator helper function * Add CreateTestEncodingConfig helper, move CreateTestValidator to utils * Add mock and tx dependencies * Add mock kepers for testing * Add DistributionKeeper to expected keepers * Add DistributionKeeper to tier module * Improve and fix logic in TierKeeper testutil * Add UnlockingLockupKey and LockupKeyToAddressesAtHeight to handle unlocking lockup keys separately * Add comments related to reward rate precision * Add MustIterateUnlockingLockups, and related helpers, improve existing logic * Add TestMustIterateUnlockingLockups and TestIterateLockups * Add mock keeper tests for Lock/Unlock * Add tests for keeper Lock, Unlock, Redelegate, and CompleteUnlocking * Update grpc_query * Fix grpc query tests * Improve and fix logic in keeper methods * Add EventTypeCancelUnlocking * Add CancelUnlocking, fix Unlock and CompleteUnlocking logic * Fix mock keeper tests * Add TestCancelUnlocking, fix existing tests * Add CancelUnlocking message, fix Unlock message * Fix comments * Add comments and minor fixes to keeper tests * Fix comment * Fix typo * Add mock TestRedelegate, improve tests * Refactor SetupKeeper() util * Validate correct address and amount in MintCredit(), add Test_MintCredit * Update codecov.yml * fix: Tier module fixes and improvements (part 3) (#10) * Add tier module events and attributes * Emit corresponding events on Lock, Unlock, Redelegate, and CompleteUnlocking * Improve CancelUnlocking to search for unbonding delegation entry by creationHeight * Add IterateValidators and TotalBondedTokens to expected staking keeper, define corresponding mocks * Fix calculation bug in TotalAmountByAddr caused by delAddr shadowing, add TestTotalAmountByAddr * Fix SubtractLockup to remove lockup if subtracting the whole locked amount, add TestHasLockup and TestGetUnlockingLockup * Refactor calculateCredit and related tests * Add SaveLockup, refactor SetLockup, fix GetLockup and removeUnlockingLockup * Add TestGetLockup and TestGetLockups, fix/improve existing tests * Use SaveLockup instead of SetLockup in InitGenesis * Update grpc query tests * Improve CancelUnlocking to support partial unlocks and fix bug in existing logic * Improve TestCancelUnlocking to verify subsequent and partial unlocks, fix/update existing tests * Improve SubtractLockup and SubtractUnlockingLockup logic to handle invalid amounts * Add TestSubtractUnlockingLockup, improve TestSubtractLockup * Improve Lock, Unlock, and Redelegate to handle invalid amounts, fix/improve related tests * Add ErrInvalidAmount * Fix typo in ErrUnauthorized, add setupMsgServer and basic TestMsgServer * Add TestMsgUpdateParams * Add TestMsgLock * Add TestMsgUnlock * Add TestMsgRedelegate * Update TestMsgLock, TestMsgUnlock, and TestMsgUpdateParams, fix error messages * Add TestMsgCancelUnlocking, minor fixes
- Loading branch information
Showing
35 changed files
with
3,301 additions
and
414 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
coverage: | ||
ignore: | ||
- "api/*" | ||
- "data/*" | ||
- "devnet/*" | ||
- "docs/*" | ||
- "example/*" | ||
- "manual/*" | ||
- "proto/*" | ||
- "scripts/*" | ||
- "testutil/*" | ||
- "api/**" | ||
- "data/**" | ||
- "devnet/**" | ||
- "docs/**" | ||
- "example/**" | ||
- "manual/**" | ||
- "proto/**" | ||
- "scripts/**" | ||
- "testutil/**" | ||
- "**/*.pb.go" | ||
- "**/*.pb.gw.go" | ||
- "**/*.pulsar.go" | ||
- "**/*_test.go" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.