diff --git a/src/StrategyTests.sol b/src/StrategyTests.sol index 6bfe56a..e8bda7a 100644 --- a/src/StrategyTests.sol +++ b/src/StrategyTests.sol @@ -11,7 +11,7 @@ contract StrategyTests is OrderBookStrategyTest { // Function to add OrderBook order and deposit tokens. // Input and Output tokens are extracted from `inputVaults` and `outputVaults`, // indexed by `inputTokenIndex` and `outputTokenIndex`. - function addOrderDepositOutputTokens(LibStrategyDeployment.StrategyDeployment memory strategy) + function addOrderDepositOutputTokens(LibStrategyDeployment.StrategyDeploymentV3 memory strategy) internal returns (OrderV3 memory order) { @@ -41,13 +41,13 @@ contract StrategyTests is OrderBookStrategyTest { vm, strategy.strategyFile, strategy.strategyScenario, strategy.buildPath, strategy.manifestPath ) ); - order = placeOrder(ORDER_OWNER, bytecode, strategy.inputVaults, strategy.outputVaults, new ActionV1[](0)); + order = placeOrder(ORDER_OWNER, bytecode, strategy.inputVaults, strategy.outputVaults, strategy.postActions); } } // Function to assert OrderBook calculations context by calling 'takeOrders' function // directly from the OrderBook contract. - function checkStrategyCalculations(LibStrategyDeployment.StrategyDeployment memory strategy) internal { + function checkStrategyCalculations(LibStrategyDeployment.StrategyDeploymentV3 memory strategy) internal { OrderV3 memory order = addOrderDepositOutputTokens(strategy); { vm.recordLogs(); @@ -65,7 +65,7 @@ contract StrategyTests is OrderBookStrategyTest { // Function to assert OrderBook calculations context by calling 'arb' function // from the OrderBookV3ArbOrderTaker contract. - function checkStrategyCalculationsArbOrder(LibStrategyDeployment.StrategyDeployment memory strategy) internal { + function checkStrategyCalculationsArbOrder(LibStrategyDeployment.StrategyDeploymentV3 memory strategy) internal { OrderV3 memory order = addOrderDepositOutputTokens(strategy); // Move external pool price in opposite direction that of the order @@ -92,7 +92,7 @@ contract StrategyTests is OrderBookStrategyTest { } function evalExpression( - LibStrategyDeployment.StrategyDeployment memory strategy, + LibStrategyDeployment.StrategyDeploymentV3 memory strategy, FullyQualifiedNamespace namespace, uint256[][] memory context, uint256[] memory inputs, diff --git a/src/lib/LibStrategyDeployment.sol b/src/lib/LibStrategyDeployment.sol index dec958c..8ab38fa 100644 --- a/src/lib/LibStrategyDeployment.sol +++ b/src/lib/LibStrategyDeployment.sol @@ -3,9 +3,10 @@ pragma solidity =0.8.25; import {Vm} from "forge-std/Vm.sol"; import {IO} from "rain.orderbook.interface/interface/IOrderBookV3.sol"; +import {ActionV1} from "rain.orderbook.interface/interface/unstable/IOrderBookV4.sol"; library LibStrategyDeployment { - struct StrategyDeployment { + struct StrategyDeploymentV3 { bytes makerRoute; bytes takerRoute; uint256 inputTokenIndex; @@ -20,5 +21,6 @@ library LibStrategyDeployment { string manifestPath; IO[] inputVaults; IO[] outputVaults; + ActionV1[] postActions; } } diff --git a/test/DeployedStrategyTest.t.sol b/test/DeployedStrategyTest.t.sol index c947607..373326a 100644 --- a/test/DeployedStrategyTest.t.sol +++ b/test/DeployedStrategyTest.t.sol @@ -60,7 +60,7 @@ contract DeployedStrategyTest is StrategyTests { uint256 expectedAmountOutputMax = 1e18; // Init params for the strategy - LibStrategyDeployment.StrategyDeployment memory strategy = LibStrategyDeployment.StrategyDeployment( + LibStrategyDeployment.StrategyDeploymentV3 memory strategy = LibStrategyDeployment.StrategyDeploymentV3( "", "", 0, @@ -74,7 +74,8 @@ contract DeployedStrategyTest is StrategyTests { "./lib/rain.orderbook", "./lib/rain.orderbook/Cargo.toml", inputVaults, - outputVaults + outputVaults, + new ActionV1[](0) ); // Assert strategy calculations by executing order by directly calling 'takeOrder' function @@ -99,7 +100,7 @@ contract DeployedStrategyTest is StrategyTests { uint256 expectedAmountOutputMax = 1e18; // Init params for the strategy - LibStrategyDeployment.StrategyDeployment memory strategy = LibStrategyDeployment.StrategyDeployment( + LibStrategyDeployment.StrategyDeploymentV3 memory strategy = LibStrategyDeployment.StrategyDeploymentV3( getEncodedBlueToRedRoute(), getEncodedRedToBlueRoute(), 0, @@ -113,7 +114,8 @@ contract DeployedStrategyTest is StrategyTests { "./lib/rain.orderbook", "./lib/rain.orderbook/Cargo.toml", inputVaults, - outputVaults + outputVaults, + new ActionV1[](0) ); // Assert strategy calculations by executing order by calling 'arb' function