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

feat: Decouple staking logic from the tier module #11

Closed
wants to merge 17 commits into from

Conversation

iverc
Copy link
Contributor

@iverc iverc commented Dec 20, 2024

Description

This PR streamlines the Tier module by removing all interactions with the staking keeper (e.g., Delegate, Undelegate, BeginRedelegation, etc.) and introduces several fixes and improvements.

Tasks

  • Refactor Lock, Unlock, Redelegate, and CancelUnlocking.
  • Get rid of unbondTime and only rely on unlockTime to complete the unlocking.
  • Return error if no unlocking lockup found in SubtractUnlockingLockup.
  • Expect unlockTime and completionTime to be nil instead of time.Time{} to reduce ambiguity.
  • Add creation_height to MsgUnlockResponse.
  • Refactor proratedCredit, add TestCalculateProratedCredit and TestProratedCredit.
  • Update and fix corresponding tests.
  • Add TestBurnAllCredits and TestResetAllCredits.

@iverc iverc requested a review from jsimnz December 20, 2024 13:13
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 96.66667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 28.67%. Comparing base (24c0f5c) to head (3eba536).

Files with missing lines Patch % Lines
x/tier/keeper/keeper.go 93.75% 1 Missing and 1 partial ⚠️
x/tier/keeper/lockup.go 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #11      +/-   ##
==========================================
+ Coverage   28.53%   28.67%   +0.14%     
==========================================
  Files         148      148              
  Lines        6225     6131      -94     
==========================================
- Hits         1776     1758      -18     
+ Misses       4336     4269      -67     
+ Partials      113      104       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iverc iverc self-assigned this Jan 7, 2025
@iverc iverc closed this Jan 17, 2025
@iverc iverc deleted the iverc/decouple-tier-staking branch January 17, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants