Skip to content

Commit

Permalink
test: use CosignerLib in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhwu committed Sep 25, 2024
1 parent 74f1286 commit ba8f909
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/reactors/V3DutchOrderReactor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {CurveBuilder} from "../util/CurveBuilder.sol";
import {OrderQuoter} from "../../src/lens/OrderQuoter.sol";
import {Solarray} from "solarray/Solarray.sol";
import {MathExt} from "../../src/lib/MathExt.sol";
import {CosignerLib} from "../../src/lib/CosignerLib.sol";

contract V3DutchOrderTest is PermitSignature, DeployPermit2, BaseReactorTest {
using OrderInfoBuilder for OrderInfo;
Expand Down Expand Up @@ -431,7 +432,7 @@ contract V3DutchOrderTest is PermitSignature, DeployPermit2, BaseReactorTest {
order.cosignature = cosignOrder(order.hash(), cosignerData);
SignedOrder memory signedOrder =
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order));
vm.expectRevert(V3DutchOrderReactor.InvalidCosignature.selector);
vm.expectRevert(CosignerLib.InvalidCosignature.selector);
fillContract.execute(signedOrder);
}

Expand Down Expand Up @@ -459,7 +460,7 @@ contract V3DutchOrderTest is PermitSignature, DeployPermit2, BaseReactorTest {
order.cosignature = bytes.concat(keccak256("invalidSignature"), keccak256("invalidSignature"), hex"33");
SignedOrder memory signedOrder =
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order));
vm.expectRevert(V3DutchOrderReactor.InvalidCosignature.selector);
vm.expectRevert(CosignerLib.InvalidCosignature.selector);
fillContract.execute(signedOrder);
}

Expand Down

0 comments on commit ba8f909

Please sign in to comment.