-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5d6ec2
commit ca568bc
Showing
1 changed file
with
53 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
// // SPDX-License-Identifier: Unlicense | ||
// pragma solidity 0.8.18; | ||
// SPDX-License-Identifier: Unlicense | ||
pragma solidity 0.8.18; | ||
|
||
// import "forge-std/Test.sol"; | ||
// import { GelatoResolver, ILiquidMiningDiamond } from "src/GelatoResolver.sol"; | ||
import "forge-std/Test.sol"; | ||
import { GelatoResolver, ILiquidMiningDiamond } from "src/GelatoResolver.sol"; | ||
|
||
// contract GelatoResolverTest is Test { | ||
// GelatoResolver gelatoResolver; | ||
// ILiquidMiningDiamond liquidMiningDiamond = ILiquidMiningDiamond(makeAddr("LiquidMiningDiamond")); | ||
// uint256 mainnetFork; | ||
contract GelatoResolverTest is Test { | ||
GelatoResolver gelatoResolver; | ||
ILiquidMiningDiamond liquidMiningDiamond = ILiquidMiningDiamond(makeAddr("LiquidMiningDiamond")); | ||
uint256 mainnetFork; | ||
|
||
// function setUp() public { | ||
// // vm.createSelectFork(vm.rpcUrl("avalanche")); | ||
// gelatoResolver = new GelatoResolver(liquidMiningDiamond); | ||
// } | ||
function setUp() public { | ||
// vm.createSelectFork(vm.rpcUrl("avalanche")); | ||
gelatoResolver = new GelatoResolver(liquidMiningDiamond); | ||
} | ||
|
||
// function test_calculateReward() public { | ||
// uint256 seasonId = 1; | ||
// uint256 expectedReward = 15000 * 10 ** 18; | ||
// uint256 actualReward = gelatoResolver.calculateReward(seasonId); | ||
// assertEq(actualReward, expectedReward); | ||
function test_calculateReward() public { | ||
uint256 seasonId = 1; | ||
uint256 expectedReward = 15000 * 10 ** 18; | ||
uint256 actualReward = gelatoResolver.calculateReward(seasonId); | ||
assertEq(actualReward, expectedReward); | ||
|
||
// seasonId = 2; | ||
// expectedReward = 14938200000000000000000; | ||
// actualReward = gelatoResolver.calculateReward(seasonId); | ||
// assertEq(actualReward, expectedReward); | ||
seasonId = 2; | ||
expectedReward = 14938200000000000000000; | ||
actualReward = gelatoResolver.calculateReward(seasonId); | ||
assertEq(actualReward, expectedReward); | ||
|
||
// seasonId = 3; | ||
// expectedReward = 14876654616000000000000; | ||
// actualReward = gelatoResolver.calculateReward(seasonId); | ||
// assertEq(actualReward, expectedReward); | ||
seasonId = 3; | ||
expectedReward = 14876654616000000000000; | ||
actualReward = gelatoResolver.calculateReward(seasonId); | ||
assertEq(actualReward, expectedReward); | ||
|
||
// seasonId = 4; | ||
// expectedReward = 14815362798982080000000; | ||
// actualReward = gelatoResolver.calculateReward(seasonId); | ||
// assertEq(actualReward, expectedReward); | ||
seasonId = 4; | ||
expectedReward = 14815362798982080000000; | ||
actualReward = gelatoResolver.calculateReward(seasonId); | ||
assertEq(actualReward, expectedReward); | ||
|
||
// seasonId = 5; | ||
// expectedReward = 14754323504250273830400; | ||
// actualReward = gelatoResolver.calculateReward(seasonId); | ||
// assertEq(actualReward, expectedReward); | ||
// } | ||
seasonId = 5; | ||
expectedReward = 14754323504250273830400; | ||
actualReward = gelatoResolver.calculateReward(seasonId); | ||
assertEq(actualReward, expectedReward); | ||
} | ||
|
||
// function test_getNextMonthFirstDayTimestamp() public { | ||
// vm.warp(1696118400); // 2023-10-01 00:00:00 | ||
// uint256 expectedTimestamp = 1698796800; // 2023-11-01 00:00:00 | ||
// uint256 actualTimestamp = gelatoResolver.getNextMonthFirstDayTimestamp(); | ||
// assertEq(actualTimestamp, expectedTimestamp); | ||
function test_getNextMonthFirstDayTimestamp() public { | ||
vm.warp(1696118400); // 2023-10-01 00:00:00 | ||
uint256 expectedTimestamp = 1698796800; // 2023-11-01 00:00:00 | ||
uint256 actualTimestamp = gelatoResolver.getNextMonthFirstDayTimestamp(); | ||
assertEq(actualTimestamp, expectedTimestamp); | ||
|
||
// vm.warp(1701388800); // 2023-12-01 00:00:00 | ||
// expectedTimestamp = 1704067200; // 2024-01-01 00:00:00 | ||
// actualTimestamp = gelatoResolver.getNextMonthFirstDayTimestamp(); | ||
// assertEq(actualTimestamp, expectedTimestamp); | ||
vm.warp(1701388800); // 2023-12-01 00:00:00 | ||
expectedTimestamp = 1704067200; // 2024-01-01 00:00:00 | ||
actualTimestamp = gelatoResolver.getNextMonthFirstDayTimestamp(); | ||
assertEq(actualTimestamp, expectedTimestamp); | ||
|
||
// vm.warp(1704067200); // 2024-01-01 00:00:00 | ||
// expectedTimestamp = 1706745600; // 2024-02-01 00:00:00 | ||
// actualTimestamp = gelatoResolver.getNextMonthFirstDayTimestamp(); | ||
// assertEq(actualTimestamp, expectedTimestamp); | ||
vm.warp(1704067200); // 2024-01-01 00:00:00 | ||
expectedTimestamp = 1706745600; // 2024-02-01 00:00:00 | ||
actualTimestamp = gelatoResolver.getNextMonthFirstDayTimestamp(); | ||
assertEq(actualTimestamp, expectedTimestamp); | ||
|
||
// vm.warp(1706745600); // 2024-02-01 00:00:00 | ||
// expectedTimestamp = 1709251200; // 2024-03-01 00:00:00 (Leap Year) | ||
// actualTimestamp = gelatoResolver.getNextMonthFirstDayTimestamp(); | ||
// assertEq(actualTimestamp, expectedTimestamp); | ||
// } | ||
// } | ||
vm.warp(1706745600); // 2024-02-01 00:00:00 | ||
expectedTimestamp = 1709251200; // 2024-03-01 00:00:00 (Leap Year) | ||
actualTimestamp = gelatoResolver.getNextMonthFirstDayTimestamp(); | ||
assertEq(actualTimestamp, expectedTimestamp); | ||
} | ||
} |