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

Add incentivized earning power update #30

Merged
merged 19 commits into from
Oct 7, 2024

Conversation

alexkeating
Copy link
Collaborator

@alexkeating alexkeating commented Sep 27, 2024

Description

  • Add function for incentivized earning power

@apbendi apbendi force-pushed the add-incentivized-earning-power-update branch from 9572a04 to ee1f4d5 Compare September 30, 2024 13:31
src/GovernanceStaker.sol Outdated Show resolved Hide resolved
@alexkeating alexkeating requested a review from apbendi October 2, 2024 15:16
@alexkeating alexkeating marked this pull request as ready for review October 2, 2024 15:16
Copy link
Collaborator

@apbendi apbendi left a comment

Choose a reason for hiding this comment

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

Hey @alexkeating, some mostly minor comments, but I did hit one failing test

src/GovernanceStaker.sol Outdated Show resolved Hide resolved
src/GovernanceStaker.sol Outdated Show resolved Hide resolved
src/GovernanceStaker.sol Outdated Show resolved Hide resolved
test/GovernanceStaker.invariants.t.sol Outdated Show resolved Hide resolved
govStaker.bumpEarningPower(_depositId, _tipReceiver, _requestedTip);
}

function testFuzz_RevertIf_NewEarningPowerIsGreaterThanTheCurrentEarningPower(
Copy link
Collaborator

Choose a reason for hiding this comment

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

The name of this test makes it sound like the method should revert if the earning power is going up. It should have a name that's something like "Revert If: Unclaimed Rewards Are Less Than The Requested Tip When Earning Power Is Being Bumped Up"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

govStaker.bumpEarningPower(_depositId, _tipReceiver, _requestedTip);
}

function testFuzz_RevertIf_NewEarningPowerIsLessThanTheCurrentEarningPower(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to the prior test, this one needs a better name. "Revert If: Unclaimed Rewards Are Insufficient To Leave An Additional Bump Tip After Current Tip Is Paid When Earning Power Is Being Bumped Down"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Small spelling error, it says "Maxc" instead of "Max"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, forgot to link the fix here 77e7a86

test/GovernanceStaker.t.sol Outdated Show resolved Hide resolved
test/GovernanceStaker.t.sol Show resolved Hide resolved
Copy link

github-actions bot commented Oct 7, 2024

Coverage after merging add-incentivized-earning-power-update into main will be

98.97%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   DelegationSurrogate.sol100%100%100%100%
   GovernanceStaker.sol98.82%100%97.73%98.96%248–249

@alexkeating alexkeating requested a review from apbendi October 7, 2024 19:09
Copy link
Collaborator

@apbendi apbendi left a comment

Choose a reason for hiding this comment

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

One small spelling error but otherwise this is good to merge.

@alexkeating alexkeating merged commit d5bf4df into main Oct 7, 2024
4 checks passed
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