order placement doesnt crash
This commit is contained in:
@@ -4,7 +4,9 @@ pragma abicoder v2;
|
||||
|
||||
import "./MockEnv.sol";
|
||||
import "forge-std/Test.sol";
|
||||
import "forge-std/console2.sol";
|
||||
import "../src/Factory.sol";
|
||||
import "../src/OrderLib.sol";
|
||||
|
||||
contract TestOrder is MockEnv, Test {
|
||||
Factory public factory;
|
||||
@@ -23,7 +25,23 @@ contract TestOrder is MockEnv, Test {
|
||||
|
||||
|
||||
function testOrder() public {
|
||||
|
||||
OrderLib.Tranche[] memory tranches = new OrderLib.Tranche[](3);
|
||||
OrderLib.Constraint[] memory constraints1 = new OrderLib.Constraint[](1);
|
||||
constraints1[0] = OrderLib.Constraint(OrderLib.ConstraintMode.Time, bytes(hex"0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000046500"));
|
||||
OrderLib.Constraint[] memory constraints2 = new OrderLib.Constraint[](1);
|
||||
constraints2[0] = OrderLib.Constraint(OrderLib.ConstraintMode.Time, bytes(hex"000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000464fb0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000008c9fb"));
|
||||
OrderLib.Constraint[] memory constraints3 = new OrderLib.Constraint[](1);
|
||||
constraints3[0] = OrderLib.Constraint(OrderLib.ConstraintMode.Time, bytes(hex"0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000008c9f6000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000d2ef6"));
|
||||
tranches[0] = OrderLib.Tranche(21845,constraints1);
|
||||
tranches[1] = OrderLib.Tranche(21845,constraints2);
|
||||
tranches[2] = OrderLib.Tranche(21845,constraints3);
|
||||
OrderLib.SwapOrder memory order = OrderLib.SwapOrder(
|
||||
0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9, 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1,
|
||||
OrderLib.Route(OrderLib.Exchange.UniswapV3, 500), 100000000000000000000, true, false,
|
||||
18446744073709551615, tranches
|
||||
);
|
||||
console2.logBytes(abi.encode(order));
|
||||
vault.placeOrder(order);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user