Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pblivin0x committed Jul 3, 2024
1 parent abbcc93 commit e81be72
Show file tree
Hide file tree
Showing 2 changed files with 265 additions and 69 deletions.
4 changes: 2 additions & 2 deletions src/staking/SnapshotStakingPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ contract SnapshotStakingPool is ISnapshotStakingPool, Ownable, ERC20Snapshot, Re
/// @inheritdoc ISnapshotStakingPool
function rewardOfInRange(address account, uint256 startSnapshotId, uint256 endSnapshotId) public view returns (uint256) {
require(startSnapshotId > 0, "ERC20Snapshot: id is 0");
require(startSnapshotId <= endSnapshotId && endSnapshotId <= _getCurrentSnapshotId(), "Cannot claim from future snapshots");
require(startSnapshotId <= endSnapshotId && endSnapshotId <= _getCurrentSnapshotId(), "ERC20Snapshot: nonexistent id");

uint256 rewards = 0;
for (uint256 i = startSnapshotId; i <= endSnapshotId; i++) {
Expand All @@ -171,7 +171,7 @@ contract SnapshotStakingPool is ISnapshotStakingPool, Ownable, ERC20Snapshot, Re
/// @inheritdoc ISnapshotStakingPool
function rewardOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {
require(snapshotId > 0, "ERC20Snapshot: id is 0");
require(snapshotId <= _getCurrentSnapshotId(), "Cannot claim from future snapshots");
require(snapshotId <= _getCurrentSnapshotId(), "ERC20Snapshot: nonexistent id");
return _rewardOfAt(account, snapshotId);
}

Expand Down
Loading

0 comments on commit e81be72

Please sign in to comment.