Skip to content

Commit

Permalink
remove console logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brean0 committed Jul 23, 2024
1 parent 1bcc72d commit 2257db8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
4 changes: 2 additions & 2 deletions test/beanstalk/BeanstalkStable2.calcReserveAtRatioSwap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ contract BeanstalkStable2SwapTest is TestHelper {
uint256 targetPrice = ratios[0] * 1e6 / ratios[1];
uint256 reservePrice0 = _f.calcRate(updatedReserves, 0, 1, data);

// estimated price and actual price are within 0.01% in the worst case.
assertApproxEqRel(reservePrice0, targetPrice, 0.0001e18, "reservePrice0 <> targetPrice");
// estimated price and actual price are within 0.015% in the worst case.
assertApproxEqRel(reservePrice0, targetPrice, 0.00015e18, "reservePrice0 <> targetPrice");
}
}
}
8 changes: 0 additions & 8 deletions test/pumps/Pump.Update.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,15 @@ contract PumpUpdateTest is TestHelper {
mWell.update(address(pump), b, data);

increaseTime(CAP_INTERVAL);

console.log(1);
console.log(4);
uint256[] memory emaReserves = pump.readInstantaneousReserves(address(mWell), data);
console.log(4);
console.log("EMA Reserves Length: %s", emaReserves.length);
assertEq(emaReserves.length, 2);
assertApproxEqAbs(emaReserves[0], 1_156_587, 1); // = 2^(log2(1000000) * 0.9^12 +log2(1224743) * (1-0.9^12))
assertApproxEqAbs(emaReserves[1], 1_729_223, 1); // = 2^(log2(2000000) * 0.9^12 +log2(1632992) * (1-0.9^12))
console.log(3);

bytes16[] memory cumulativeReserves = abi.decode(pump.readCumulativeReserves(address(mWell), data), (bytes16[]));
assertApproxEqAbs(cumulativeReserves[0].div(ABDKMathQuad.fromUInt(12)).pow_2().toUInt(), 1_224_743, 1);
assertApproxEqAbs(cumulativeReserves[1].div(ABDKMathQuad.fromUInt(12)).pow_2().toUInt(), 1_632_992, 1);

console.log(4);

(uint256[] memory twaReserves, bytes memory twaCumulativeReservesBytes) =
pump.readTwaReserves(address(mWell), startCumulativeReserves, block.timestamp - CAP_INTERVAL, data);

Expand Down

0 comments on commit 2257db8

Please sign in to comment.