Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distribute flow flakey test fix #1821

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -383,23 +383,23 @@ 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));

_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();

Expand All @@ -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));
Expand All @@ -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();

Expand Down
Loading