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

Open
wants to merge 11 commits into
base: dev
Choose a base branch
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.

As a result, the developer stake will remain stored in the Tier module, so that it is no longer affected by slashing and won't be eligible for rewards.

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 and add Test_CalculateProratedCredit.
  • Update and fix corresponding tests.

@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.42857% with 3 lines in your changes missing coverage. Please review.

Project coverage is 27.98%. Comparing base (24c0f5c) to head (13ca3fe).

Files with missing lines Patch % Lines
x/tier/keeper/keeper.go 93.10% 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%   27.98%   -0.55%     
==========================================
  Files         148      148              
  Lines        6225     6128      -97     
==========================================
- Hits         1776     1715      -61     
+ Misses       4336     4312      -24     
+ Partials      113      101      -12     

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

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