Skip to content

Commit

Permalink
fix tests that break when compiled with --ir-minimum (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyqs authored Oct 25, 2024
1 parent eb5f70c commit 958f95d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions staking/test/RWAStaking.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ contract RWAStakingTest is Test {
uint256 stakeAmount = 100 ether;
uint256 pusdStakeAmount = 30 ether;
uint256 timeskipAmount = 300;
uint256 startTime = block.timestamp;
uint256 startTime = 1;
vm.warp(startTime);
helper_initialStake(user1, stakeAmount);

(uint256 amountSeconds, uint256 amountStaked, uint256 lastUpdate) = rwaStaking.getUserState(user1);
Expand Down Expand Up @@ -312,7 +313,8 @@ contract RWAStakingTest is Test {
function test_withdraw() public {
uint256 stakeAmount = 100 ether;
uint256 timeskipAmount = 300;
uint256 startTime = block.timestamp;
uint256 startTime = 1;
vm.warp(startTime);

// Stake from user1
helper_initialStake(user1, stakeAmount);
Expand Down Expand Up @@ -392,7 +394,8 @@ contract RWAStakingTest is Test {
function test_stake() public {
uint256 stakeAmount = 100 ether;
uint256 timeskipAmount = 300;
uint256 startTime = block.timestamp;
uint256 startTime = 1;
vm.warp(startTime);

// Stake 100 USDC from user1
helper_initialStake(user1, stakeAmount);
Expand Down
9 changes: 6 additions & 3 deletions staking/test/ReserveStaking.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ contract ReserveStakingTest is Test {
uint256 sbtcAmount = 100 ether;
uint256 stoneAmount = 50 ether;
uint256 timeskipAmount = 300;
uint256 startTime = block.timestamp;
uint256 startTime = 1;
vm.warp(startTime);
helper_initialStake(user1, sbtcAmount, stoneAmount);

(
Expand Down Expand Up @@ -324,7 +325,8 @@ contract ReserveStakingTest is Test {
uint256 sbtcAmount = 100 ether;
uint256 stoneAmount = 50 ether;
uint256 timeskipAmount = 300;
uint256 startTime = block.timestamp;
uint256 startTime = 1;
vm.warp(startTime);

// Stake from user1
helper_initialStake(user1, sbtcAmount, stoneAmount);
Expand Down Expand Up @@ -425,7 +427,8 @@ contract ReserveStakingTest is Test {
uint256 sbtcAmount = 100 ether;
uint256 stoneAmount = 50 ether;
uint256 timeskipAmount = 300;
uint256 startTime = block.timestamp;
uint256 startTime = 1;
vm.warp(startTime);

// Stake from user1
helper_initialStake(user1, sbtcAmount, stoneAmount);
Expand Down

0 comments on commit 958f95d

Please sign in to comment.