Skip to content

Commit

Permalink
supposed gutter, but doesn't improve cov, conditionals bugged coverag…
Browse files Browse the repository at this point in the history
…e wise.
  • Loading branch information
simplemachine92 committed Apr 22, 2024
1 parent 7472e9d commit 73f647c
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,42 @@ contract TestSetFundAccessLimitsFor_Local is JBFundAccessSetup {

_fundAccess.setFundAccessLimitsFor(_projectId, _ruleset, _fundAccessLimitGroup);
}

function test_GivenValidConfigWithLimitsZero() external whenCallerIsControllerOfProject {
// it will set packed properties and emit SetFundAccessLimits

// Fund Access config
JBFundAccessLimitGroup[] memory _fundAccessLimitGroup = new JBFundAccessLimitGroup[](2);
{
// Specify a payout limit.
JBCurrencyAmount[] memory _payoutLimits = new JBCurrencyAmount[](1);
_payoutLimits[0] = JBCurrencyAmount({amount: 0, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))});

// Specify a surplus allowance.
JBCurrencyAmount[] memory _surplusAllowances = new JBCurrencyAmount[](1);
_surplusAllowances[0] = JBCurrencyAmount({amount: 0, currency: type(uint32).max});

_fundAccessLimitGroup[0] = JBFundAccessLimitGroup({
terminal: address(_terminal),
token: JBConstants.NATIVE_TOKEN,
payoutLimits: _payoutLimits,
surplusAllowances: _surplusAllowances
});

_fundAccessLimitGroup[1] = JBFundAccessLimitGroup({
terminal: address(_terminal2),
token: JBConstants.NATIVE_TOKEN,
payoutLimits: _payoutLimits,
surplusAllowances: _surplusAllowances
});
}

vm.expectEmit();
emit IJBFundAccessLimits.SetFundAccessLimits(_ruleset, _projectId, _fundAccessLimitGroup[0], address(this));

vm.expectEmit();
emit IJBFundAccessLimits.SetFundAccessLimits(_ruleset, _projectId, _fundAccessLimitGroup[1], address(this));

_fundAccess.setFundAccessLimitsFor(_projectId, _ruleset, _fundAccessLimitGroup);
}
}

0 comments on commit 73f647c

Please sign in to comment.