Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
snreynolds committed Aug 3, 2024
1 parent 8b18650 commit 4fc5e96
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/libraries/CalldataDecoder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ contract CalldataDecoderTest is Test {
assertEq(_address, __address);
}

function test_fuzz_decodeCurrencyAddressAndUint256(Currency _currency, address _addr, uint256 _amount)
public
view
{
bytes memory params = abi.encode(_currency, _addr, _amount);
(Currency currency, address addr, uint256 amount) = decoder.decodeCurrencyAddressAndUint256(params);

assertEq(Currency.unwrap(currency), Currency.unwrap(_currency));
assertEq(addr, _addr);
assertEq(amount, _amount);
}

function test_fuzz_decodeCurrencyAndUint256(Currency _currency, uint256 _amount) public view {
bytes memory params = abi.encode(_currency, _amount);
(Currency currency, uint256 amount) = decoder.decodeCurrencyAndUint256(params);
Expand Down
8 changes: 8 additions & 0 deletions test/mocks/MockCalldataDecoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,12 @@ contract MockCalldataDecoder {
function decodeCurrencyAndUint256(bytes calldata params) external pure returns (Currency currency, uint256 _uint) {
return params.decodeCurrencyAndUint256();
}

function decodeCurrencyAddressAndUint256(bytes calldata params)
external
pure
returns (Currency currency, address addr, uint256 amount)
{
return params.decodeCurrencyAddressAndUint256();
}
}
2 changes: 2 additions & 0 deletions test/position-managers/PositionManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,8 @@ contract PositionManagerTest is Test, PosmTestSetup, LiquidityFuzzers {
currency1.balanceOfSelf(), balanceBefore1 - uint256(-int256(deltaDecrease.amount1() + deltaMint.amount1()))
);
assertEq(lpm.ownerOf(tokenIdMint), address(this));
assertLt(currency1.balanceOfSelf(), balanceBefore1); // currency1 was owed
assertLt(uint256(int256(deltaDecrease.amount1())), uint256(int256(-deltaMint.amount1()))); // amount1 in the second position was greater than amount1 in the first position
}

function test_mint_slippageRevert() public {}
Expand Down

0 comments on commit 4fc5e96

Please sign in to comment.