Skip to content

Commit

Permalink
docs: polish NatSpec
Browse files Browse the repository at this point in the history
test: polish tests
  • Loading branch information
PaulRBerg committed Jun 20, 2024
1 parent 71ccb90 commit 102b49f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/SablierV2MerkleLockupFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ contract SablierV2MerkleLockupFactory is ISablierV2MerkleLockupFactory {
{
uint64 totalPercentage;
for (uint256 i = 0; i < tranches.length; ++i) {
// It would revert if the sum of percentages overflows.
totalPercentage += tranches[i].unlockPercentage.unwrap();
}
return totalPercentage == uUNIT;
Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/ISablierV2MerkleLockupFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ interface ISablierV2MerkleLockupFactory {
CONSTANT FUNCTIONS
//////////////////////////////////////////////////////////////////////////*/

/// @notice Verify the sum of percentages in `tranches` equals 100% , i.e. 1e18.
/// @notice Verifies if the sum of percentages in `tranches` equals 100% , i.e. 1e18.
/// @dev Reverts if the sum of percentages overflows.
/// @param tranches The tranches with their respective unlock percentages.
/// @return result True if the sum of percentages equals 100%, otherwise false.
function isPercentagesSum100(MerkleLT.TrancheWithPercentage[] calldata tranches)
external
pure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract IsPercentagesSum100_Integration_Test is MerkleLockup_Integration_Test {
}

function test_TotalPercentageLessThanOneHundred()
public
external
view
whenSumDoesNotOverflow
whenTotalPercentageNotOneHundred
Expand All @@ -38,7 +38,7 @@ contract IsPercentagesSum100_Integration_Test is MerkleLockup_Integration_Test {
}

function test_TotalPercentageGreaterThanOneHundred()
public
external
view
whenSumDoesNotOverflow
whenTotalPercentageNotOneHundred
Expand All @@ -54,7 +54,7 @@ contract IsPercentagesSum100_Integration_Test is MerkleLockup_Integration_Test {
_;
}

function test_IsPercentagesSum100() public view whenSumDoesNotOverflow whenTotalPercentageOneHundred {
function test_IsPercentagesSum100() external view whenSumDoesNotOverflow whenTotalPercentageOneHundred {
assertTrue(merkleLockupFactory.isPercentagesSum100(defaults.tranchesWithPercentages()), "isPercentagesSum100");
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
isPercentagesSum100.t.sol
├── when the sum of the percentages overflows
└── it should revert
│ └── it should revert
└── when the sum of the percentages does not overflow
├── when the sum of the percentages does not equal 100%
├── when the sum of the percentages is less than 100%
└── it should return false
└── when the sum of the percentages is greater than 100%
└── it should return false
└── when the sum of the percentages equals 100%
└── it should return true
├── when the sum of the percentages does not equal 100%
├── when the sum of the percentages is less than 100%
└── it should return false
└── when the sum of the percentages is greater than 100%
└── it should return false
└── when the sum of the percentages equals 100%
└── it should return true

0 comments on commit 102b49f

Please sign in to comment.