From 8e40e6e62b7b029f8b941221ddc07c5fb57f7aba Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Wed, 10 Apr 2024 12:53:34 +0530 Subject: [PATCH] update compose --- src/{StrategyTests.t.sol => StrategyTests.sol} | 2 +- src/lib/LibComposeOrder.sol | 6 +++--- src/lib/LibStrategyDeployment.sol | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) rename src/{StrategyTests.t.sol => StrategyTests.sol} (96%) diff --git a/src/StrategyTests.t.sol b/src/StrategyTests.sol similarity index 96% rename from src/StrategyTests.t.sol rename to src/StrategyTests.sol index 68067fe..9bdbbff 100644 --- a/src/StrategyTests.t.sol +++ b/src/StrategyTests.sol @@ -30,7 +30,7 @@ contract StrategyTests is OrderBookStrategyTest { OrderV2 memory order; { (bytes memory bytecode, uint256[] memory constants) = PARSER.parse( - LibComposeOrders.getComposedOrder(vm, strategy.strategyFile, strategy.strategyScenario) + LibComposeOrders.getComposedOrder(vm, strategy.strategyFile, strategy.strategyScenario, strategy.buildPath, strategy.manifestPath) ); order = placeOrder(ORDER_OWNER, bytecode, constants, strategy.inputVaults, strategy.outputVaults); } diff --git a/src/lib/LibComposeOrder.sol b/src/lib/LibComposeOrder.sol index 820b219..eb6dda1 100644 --- a/src/lib/LibComposeOrder.sol +++ b/src/lib/LibComposeOrder.sol @@ -7,19 +7,19 @@ library LibComposeOrders { using Strings for address; using Strings for uint256; - function getComposedOrder(Vm vm, string memory filePath, string memory scenario) + function getComposedOrder(Vm vm, string memory filePath, string memory scenario, string memory buildPath, string memory manifestPath) internal returns (bytes memory trancheOrder) { string[] memory ffi = new string[](16); ffi[0] = "nix"; ffi[1] = "develop"; - ffi[2] = "./lib/rain.orderbook"; + ffi[2] = buildPath; ffi[3] = "--command"; ffi[4] = "cargo"; ffi[5] = "run"; ffi[6] = "--manifest-path"; - ffi[7] = "./lib/rain.orderbook/Cargo.toml"; + ffi[7] = manifestPath; ffi[8] = "--package"; ffi[9] = "rain_orderbook_cli"; ffi[10] = "order"; diff --git a/src/lib/LibStrategyDeployment.sol b/src/lib/LibStrategyDeployment.sol index 68b1bed..603dd98 100644 --- a/src/lib/LibStrategyDeployment.sol +++ b/src/lib/LibStrategyDeployment.sol @@ -18,6 +18,8 @@ library LibStrategyDeployment { uint256 expectedAmount; string strategyFile; string strategyScenario; + string buildPath; + string manifestPath; IO[] inputVaults; IO[] outputVaults; }