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

fix(gar): do not remove delegate before decreasing stake #283

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

dtfiedler
Copy link
Collaborator

No description provided.

@@ -395,7 +395,6 @@ local function assertAndSanitizeInputs(msg)
.. msg.Timestamp
)
assert(msg.From, "From is required")
assert(msg.Id, "Id is required")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was blocking some dry-runs like Info - but not others 🤔

@@ -2055,7 +2067,6 @@ function unlockGatewayDelegateVault(gateway, delegateAddress, vaultId)
assert(vault, "Vault not found")

balances.increaseBalance(delegateAddress, vault.balance)
gateway.delegates[delegateAddress] = nil
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we nil out delegate in decreaseDelegateStakeAtGateway if necessary

Copy link
Collaborator Author

@dtfiedler dtfiedler Dec 18, 2024

Choose a reason for hiding this comment

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

actually need to change - i don't think we should be calling decreaseDelegateStakeAtGateway here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.44%. Comparing base (d7132d9) to head (7b55fd5).

Files with missing lines Patch % Lines
src/gar.lua 85.71% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #283      +/-   ##
===========================================
+ Coverage    94.42%   94.44%   +0.02%     
===========================================
  Files           10       10              
  Lines         2976     2987      +11     
===========================================
+ Hits          2810     2821      +11     
  Misses         166      166              

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

assert(delegate, "Delegate is required")
-- zero is allowed as it is a no-op
assert(
quantity and utils.isInteger(quantity) and quantity >= 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nit: we could change this to be greater than the delegate.totalDelegatedStake

@dtfiedler dtfiedler merged commit 4de7fd4 into develop Dec 18, 2024
5 checks passed
@dtfiedler dtfiedler deleted the hotfix-gar branch December 18, 2024 16:15
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.

3 participants