Skip to content

Commit 7a916b8

Browse files
committed
test: update mock strat
1 parent f3fed18 commit 7a916b8

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

test/utils/mocks/MockLiquidityStrategy.sol

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import { LiquidityTypes as LQ } from "contracts/v3/libraries/LiquidityTypes.sol"
66

77
contract MockLiquidityStrategy is ILiquidityStrategy {
88
bool public executionResult = true;
9-
bytes public lastCallback;
109
LQ.Action public lastAction;
1110
bytes public executionCallback;
1211

1312
// Execution tracking for testing
1413
uint256 public executionCount;
1514
uint256 public lastInputAmount;
15+
uint256 public lastIncentiveAmount;
16+
bool public lastIsToken0Debt;
1617

1718
function setExecutionResult(bool _result) external {
1819
executionResult = _result;
@@ -22,20 +23,18 @@ contract MockLiquidityStrategy is ILiquidityStrategy {
2223
executionCallback = _callback;
2324
}
2425

25-
function execute(LQ.Action memory _action, bytes memory _callback) external returns (bool) {
26+
function execute(LQ.Action calldata _action) external returns (bool) {
2627
lastAction = _action;
27-
lastCallback = _callback;
2828

2929
// Track execution count
3030
executionCount++;
31+
lastInputAmount = _action.inputAmount;
3132

32-
// Decode and track input amount for testing
33-
if (_callback.length > 0) {
34-
(uint256 inputAmount, , , , , ) = abi.decode(
35-
_callback,
36-
(uint256, LQ.Direction, uint256, LQ.LiquiditySource, bool, bytes)
37-
);
38-
lastInputAmount = inputAmount;
33+
// Decode action data if present
34+
if (_action.data.length > 0) {
35+
(uint256 incentiveAmount, bool isToken0Debt) = abi.decode(_action.data, (uint256, bool));
36+
lastIncentiveAmount = incentiveAmount;
37+
lastIsToken0Debt = isToken0Debt;
3938
}
4039

4140
// Execute callback if set (to simulate price changes after execution)
@@ -52,5 +51,7 @@ contract MockLiquidityStrategy is ILiquidityStrategy {
5251
function resetTracking() external {
5352
executionCount = 0;
5453
lastInputAmount = 0;
54+
lastIncentiveAmount = 0;
55+
lastIsToken0Debt = false;
5556
}
5657
}

0 commit comments

Comments
 (0)