Skip to content

Commit

Permalink
Merge branch 'nonfuzzy-fill' of github.com:ajna-finance/contracts int…
Browse files Browse the repository at this point in the history
…o nonfuzzy-fill
  • Loading branch information
Ed Noepel committed Jan 8, 2023
2 parents a0b12b7 + 7157a9d commit 9b6e560
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/forge/utils/FenwickTreeInstance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ contract FenwickTreeInstance is DSTestPlus {
) external {
uint256 i;
uint256 amount;
uint256 cumulativeAmount;

// Initialize and print seed for randomness
setRandomSeed(seed_);
Expand All @@ -133,15 +134,16 @@ contract FenwickTreeInstance is DSTestPlus {

// Update values
add(i, amount);
amount_ -= amount;
insertions_ -= 1;
amount_ -= amount;
insertions_ -= 1;
cumulativeAmount += amount;

// Verify tree sum
assertEq(deposits.treeSum(), amount_ - amount_);
assertEq(deposits.treeSum(), cumulativeAmount);

if (trackInserts) inserts.push(i);
}

assertEq(deposits.treeSum(), amount_);
assertEq(deposits.treeSum(), cumulativeAmount);
}
}

0 comments on commit 9b6e560

Please sign in to comment.