Skip to content

Commit

Permalink
Fix E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
xavikh committed Feb 28, 2025
1 parent bae8691 commit c002946
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ ft-mode-sepolia-fork-110 :; forge test --match-contract TestE2EV1_1_0 \
--rpc-url https://sepolia.mode.network \
-vvvvv

ft-mode-sepolia-fork-120 :; forge test --match-contract TestE2EV1_2_0 \
--rpc-url https://sepolia.mode.network \
-vvvvv

# Fork testing - mode mainnet
ft-mode-fork-100 :; forge test --match-contract TestE2E \
--rpc-url https://mainnet.mode.network/ \
Expand All @@ -41,7 +45,23 @@ ft-mode-fork-100 :; forge test --match-contract TestE2E \
ft-mode-fork-110 :; forge test --match-contract TestE2EV1_1_0 \
--rpc-url https://mainnet.mode.network/ \
-vvvvv


ft-mode-fork-120 :; forge test --match-contract TestE2EV1_2_0 \
--rpc-url https://mainnet.mode.network/ \
-vvvvv

# Fork testing - sepolia
ft-sepolia-fork-100 :; forge test --match-contract TestE2E \
--rpc-url $(RPC_URL) \
-vvvvv

ft-sepolia-fork-110 :; forge test --match-contract TestE2EV1_1_0 \
--rpc-url $(RPC_URL) \
-vvvvv

ft-sepolia-fork-120 :; forge test --match-contract TestE2EV1_2_0 \
--rpc-url $(RPC_URL) \
-vvvvv

## Upgrade testing
ft-mode-upgrade-fork :; forge test --match-contract UpgradeModeTo110 \
Expand Down
11 changes: 4 additions & 7 deletions test/v1_2_0/fork/e2e.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {DAO} from "@aragon/osx/core/dao/DAO.sol";
import {Multisig, MultisigSetup} from "@aragon/multisig/MultisigSetup.sol";
import {UUPSUpgradeable as UUPS} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {VotingEscrow, Clock, Lock, QuadraticIncreasingEscrow, ExitQueue, SimpleGaugeVoter, SimpleGaugeVoterSetup, ISimpleGaugeVoterSetupParams, IWithdrawalQueueErrors, IGaugeVote, IEscrowCurveTokenStorage, GaugesDaoFactory, GaugePluginSet, Deployment, DeployGauges, DeploymentParameters} from "../versions.sol";
import {VotingEscrow, Clock, Lock, QuadraticIncreasingEscrow, ExitQueue, SimpleGaugeVoter, SimpleGaugeVoterSetup, ISimpleGaugeVoterSetupParams, IWithdrawalQueueErrors, IGaugeVote, IEscrowCurveTokenStorage, GaugesDaoFactory, GaugePluginSet, Deployment, DeploymentParameters, DeployGauges} from "../versions.sol";

interface IERC20Mint is IERC20 {
function mint(address _to, uint256 _amount) external;
Expand Down Expand Up @@ -43,7 +43,7 @@ contract MultisigReceiver is GhettoMultisig {
* 4. A more robust suite for admininstration of the contracts
* 5. Ability to connect to an existing deployment and test on the real network
*/
contract TestE2E is AragonTest, IWithdrawalQueueErrors, IGaugeVote, IEscrowCurveTokenStorage {
contract TestE2EV1_2_0 is AragonTest, IWithdrawalQueueErrors, IGaugeVote, IEscrowCurveTokenStorage {
error VotingInactive();
error OnlyEscrow();
error GaugeDoesNotExist(address _pool);
Expand Down Expand Up @@ -1394,7 +1394,6 @@ contract TestE2E is AragonTest, IWithdrawalQueueErrors, IGaugeVote, IEscrowCurve

assertEq(1, clock.currentSeasonIndex(), "SeasonIndex should be 1");


assertEq(escrow.votingPower(1), depositAlice0, "Alice should have voting power");
assertTrue(curve.isWarm(1), "Alice should be warm");

Expand All @@ -1405,12 +1404,12 @@ contract TestE2E is AragonTest, IWithdrawalQueueErrors, IGaugeVote, IEscrowCurve
//_startNewSeason();

// fast forward to the checkpoint interval carol is warm
goToEpochStartPlus(clock.checkpointInterval() + 2 days);
goToEpochStartPlus(clock.checkpointInterval() + 3 days - 1);

assertEq(escrow.votingPower(1), 260932937932153600000, "Alice vp should have more voting power");

assertEq(escrow.votingPower(2), 260932937932153600000, "Carol vp should have more voting power");
assertTrue(curve.isWarm(2), "Carol should be warm");
assertEq(escrow.votingPower(2), 260932937932153600000, "Carol vp should have more voting power");

// start a withdrawal that finish before the new season
vm.startPrank(alice);
Expand All @@ -1420,8 +1419,6 @@ contract TestE2E is AragonTest, IWithdrawalQueueErrors, IGaugeVote, IEscrowCurve
}
vm.stopPrank();

assertEq(escrow.votingPower(1), 260932937932153600000, "Alice vp should still be not zero");

goToEpochStartPlus(clock.checkpointInterval() * 2);

assertEq(escrow.votingPower(1), 0, "Alice should have no voting power");
Expand Down

0 comments on commit c002946

Please sign in to comment.