Skip to content

Commit

Permalink
👷 mock accrued rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
Flocqst committed Oct 29, 2024
1 parent 7b9b12f commit c7e5aea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/mocks/MockStakingRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,18 @@ contract MockStakingRewards {
return stakedBalances[account];
}

/// @notice Simulates rewards being added to a staker's balance
/// @dev This function also increases the total staked amount and requires
/// the reward tokens to be transferred to this contract first
/// @param staker The address receiving the rewards
/// @param amount The amount of rewards to add
function addRewardToStaker(address staker, uint256 amount) external {
require(
stakingToken.balanceOf(address(this)) >= amount,
"Insufficient reward tokens"
);
stakedBalances[staker] += amount;
totalStaked += amount;
}

}

0 comments on commit c7e5aea

Please sign in to comment.