Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
kosecki123 committed Apr 23, 2024
1 parent 0a70467 commit 9766421
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/FlatFeeCalculator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ contract FlatFeeCalculator is IFeeCalculator, Ownable {

function sumOf(uint256[] memory array) private pure returns (uint256) {
uint256 total = 0;
for (uint i = 0; i < array.length; i++) {
for (uint256 i = 0; i < array.length; i++) {
total += array[i];
}
return total;
Expand Down
20 changes: 15 additions & 5 deletions test/FlatFeeCalculatorFuzzy/FlatFeeCalculator.fuzzy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ contract FlatFeeCalculatorTestFuzzy is Test {
assertEq(feeDistribution.recipients.length, feeDistribution.shares.length, "array length mismatch");
assertEq(recipients[0], feeRecipient);

uint256 expected = 3*redemptionAmount*feeCalculator.feeBasisPoints() / 10000;
uint256 expected = 3 * redemptionAmount * feeCalculator.feeBasisPoints() / 10000;
assertEq(fees[0], expected);
}

Expand Down Expand Up @@ -163,7 +163,11 @@ contract FlatFeeCalculatorTestFuzzy is Test {
assertEq(feeDistribution.shares[0], expected);
}

function testCalculateRedemptionAmount_TCO2(uint256 redemptionAmount1, uint256 redemptionAmount2, uint256 redemptionAmount3) public {
function testCalculateRedemptionAmount_TCO2(
uint256 redemptionAmount1,
uint256 redemptionAmount2,
uint256 redemptionAmount3
) public {
// Arrange
vm.assume(redemptionAmount1 > 100);
vm.assume(redemptionAmount1 < 1e18 * 1e18);
Expand All @@ -183,12 +187,17 @@ contract FlatFeeCalculatorTestFuzzy is Test {

FeeDistribution memory feeDistribution = feeCalculator.calculateRedemptionFees(empty, tco2s, redemptionAmounts);

uint256 expected = (redemptionAmount1 + redemptionAmount2 + redemptionAmount3) * feeCalculator.feeBasisPoints() / 10000;
uint256 expected =
(redemptionAmount1 + redemptionAmount2 + redemptionAmount3) * feeCalculator.feeBasisPoints() / 10000;

assertEq(feeDistribution.shares[0], expected);
}

function testCalculateRedemptionAmount_ERC1155(uint256 redemptionAmount1, uint256 redemptionAmount2, uint256 redemptionAmount3) public {
function testCalculateRedemptionAmount_ERC1155(
uint256 redemptionAmount1,
uint256 redemptionAmount2,
uint256 redemptionAmount3
) public {
// Arrange
vm.assume(redemptionAmount1 > 100);
vm.assume(redemptionAmount1 < 1e18 * 1e18);
Expand All @@ -213,7 +222,8 @@ contract FlatFeeCalculatorTestFuzzy is Test {
FeeDistribution memory feeDistribution =
feeCalculator.calculateRedemptionFees(empty, erc1155s, tokenIds, redemptionAmounts);

uint256 expected = (redemptionAmount1 + redemptionAmount2 + redemptionAmount3) * feeCalculator.feeBasisPoints() / 10000;
uint256 expected =
(redemptionAmount1 + redemptionAmount2 + redemptionAmount3) * feeCalculator.feeBasisPoints() / 10000;

assertEq(feeDistribution.shares[0], expected);
}
Expand Down

0 comments on commit 9766421

Please sign in to comment.