From de680a260a5cdc9102eb2ae9ec0ccda888df2c35 Mon Sep 17 00:00:00 2001 From: 0xdavinchee <0xdavinchee@gmail.com> Date: Mon, 5 Feb 2024 10:02:07 +0200 Subject: [PATCH] distribute flow flakey test fix --- .../gdav1/GeneralDistributionAgreement.t.sol | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol index 166252c666..956ef3e7f7 100644 --- a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol @@ -45,7 +45,7 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste SuperfluidPool public freePool; uint256 public liquidationPeriod; - constructor() FoundrySuperfluidTester(7) { } + constructor() FoundrySuperfluidTester(10) { } function setUp() public override { super.setUp(); @@ -383,15 +383,15 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste mock.validateStorageLayout(); } - function testDistributeFlowUsesMinDeposit( + function testDistributeFlowUsesMinDepositWhenFlowDepositIsLess( uint64 distributionFlowRate, - uint32 minDepositMultiplier, + uint32 minDepositFlowRate, address member, FoundrySuperfluidTester._StackVars_UseBools memory useBools_, PoolConfig memory config ) public { ISuperfluidPool pool = _helperCreatePool(superToken, alice, alice, false, config); - vm.assume(distributionFlowRate < minDepositMultiplier); + vm.assume(distributionFlowRate < minDepositFlowRate); vm.assume(distributionFlowRate > 0); vm.assume(member != address(pool)); vm.assume(member != address(0)); @@ -399,7 +399,7 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste _addAccount(member); vm.startPrank(address(sf.governance.owner())); - uint256 minimumDeposit = 4 hours * uint256(minDepositMultiplier); + uint256 minimumDeposit = 4 hours * uint256(minDepositFlowRate); sf.governance.setSuperTokenMinimumDeposit(sf.host, superToken, minimumDeposit); vm.stopPrank(); @@ -410,15 +410,15 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste assertEq(buffer, minimumDeposit, "GDAv1.t: Min buffer should be used"); } - function testDistributeFlowIgnoresMinDeposit( + function testDistributeFlowIgnoresMinDepositWhenFlowDepositIsGreater( int32 distributionFlowRate, - uint32 minDepositMultiplier, + uint32 minDepositFlowRate, address member, FoundrySuperfluidTester._StackVars_UseBools memory useBools_, PoolConfig memory config ) public { ISuperfluidPool pool = _helperCreatePool(superToken, alice, alice, false, config); - vm.assume(uint32(distributionFlowRate) >= minDepositMultiplier); + vm.assume(uint32(distributionFlowRate) >= minDepositFlowRate); vm.assume(distributionFlowRate > 0); vm.assume(member != address(0)); vm.assume(member != address(freePool)); @@ -427,7 +427,7 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste vm.startPrank(address(sf.governance.owner())); - uint256 minimumDeposit = 4 hours * uint256(minDepositMultiplier); + uint256 minimumDeposit = 4 hours * uint256(minDepositFlowRate); sf.governance.setSuperTokenMinimumDeposit(sf.host, superToken, minimumDeposit); vm.stopPrank();