Skip to content

Commit

Permalink
fix: naming
Browse files Browse the repository at this point in the history
  • Loading branch information
marktoda committed Oct 23, 2024
1 parent 605fa98 commit 55294fb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions test/base/BaseReactor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
vm.expectEmit(true, true, true, true, address(reactor));
emit Fill(orderHash, address(fillContract), swapper, order.info.nonce);
// execute order
_snapGas("ExecuteSingle");
_snapStart("ExecuteSingle");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -162,7 +162,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
vm.expectEmit(true, true, true, true, address(reactor));
emit Fill(orderHash, address(fillContract), swapper, order.info.nonce);
// execute order
_snapGas("BaseExecuteSingleWithFee");
_snapStart("BaseExecuteSingleWithFee");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -202,7 +202,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
vm.expectEmit(true, true, true, true, address(reactor));
emit Fill(orderHash, address(fillContract), swapper, order.info.nonce);
// execute order
_snapGas("ExecuteSingleNativeOutput");
_snapStart("ExecuteSingleNativeOutput");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -246,7 +246,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
vm.expectEmit(true, true, true, true, address(reactor));
emit Fill(orderHash, address(fillContract), swapper, order.info.nonce);
// execute order
_snapGas("ExecuteSingleValidation");
_snapStart("ExecuteSingleValidation");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -297,7 +297,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
vm.expectEmit(true, true, true, true);
emit Fill(orderHashes[1], address(fillContract), swapper, orders[1].info.nonce);

_snapGas("ExecuteBatch");
_snapStart("ExecuteBatch");
fillContract.executeBatch(signedOrders);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -345,7 +345,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
vm.expectEmit(true, true, true, true);
emit Fill(orderHashes[1], address(fillContract), swapper, orders[1].info.nonce);

_snapGas("ExecuteBatchNativeOutput");
_snapStart("ExecuteBatchNativeOutput");
fillContract.executeBatch(signedOrders);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -397,7 +397,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
vm.expectEmit(true, true, true, true);
emit Fill(orderHashes[1], address(fillContract), swapper, orders[1].info.nonce);

_snapGas("ExecuteBatchMultipleOutputs");
_snapStart("ExecuteBatchMultipleOutputs");
fillContract.executeBatch(signedOrders);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -454,7 +454,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
vm.expectEmit(true, true, true, true);
emit Fill(orderHashes[1], address(fillContract), swapper, orders[1].info.nonce);

_snapGas("ExecuteBatchMultipleOutputsDifferentTokens");
_snapStart("ExecuteBatchMultipleOutputsDifferentTokens");
fillContract.executeBatch(signedOrders);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -555,7 +555,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
? OrderAlreadyFilled.selector
: InvalidNonce.selector;
vm.expectRevert(revertData);
_snapGas("RevertInvalidNonce");
_snapStart("RevertInvalidNonce");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();
}
Expand Down Expand Up @@ -857,7 +857,7 @@ abstract contract BaseReactorTest is ReactorEvents, Test, DeployPermit2 {
fillContractOutputBalanceStart = tokenOut.balanceOf(address(fillContract));
}

function _snapGas(string memory testName) internal {
function _snapStart(string memory testName) internal {
vm.startSnapshotGas(string.concat("Base-", name(), "-", testName));
}
}
8 changes: 4 additions & 4 deletions test/reactors/PriorityOrderReactor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ contract PriorityOrderReactorTest is PermitSignature, DeployPermit2, BaseReactor
vm.expectEmit(true, true, true, true, address(reactor));
emit Fill(orderHash, address(fillContract), swapper, order.info.nonce);
// execute order
_snapGas("OutputPriorityFee");
_snapStart("OutputPriorityFee");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -182,7 +182,7 @@ contract PriorityOrderReactorTest is PermitSignature, DeployPermit2, BaseReactor
vm.expectEmit(true, true, true, true, address(reactor));
emit Fill(orderHash, address(fillContract), swapper, order.info.nonce);
// execute order
_snapGas("OutputPriorityFeeAndBaselinePriorityFee");
_snapStart("OutputPriorityFeeAndBaselinePriorityFee");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -286,7 +286,7 @@ contract PriorityOrderReactorTest is PermitSignature, DeployPermit2, BaseReactor
vm.expectEmit(true, true, true, true, address(reactor));
emit Fill(orderHash, address(fillContract), swapper, order.info.nonce);
// execute order
_snapGas("InputPriorityFee");
_snapStart("InputPriorityFee");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -321,7 +321,7 @@ contract PriorityOrderReactorTest is PermitSignature, DeployPermit2, BaseReactor
vm.expectEmit(true, true, true, true, address(reactor));
emit Fill(orderHash, address(fillContract), swapper, order.info.nonce);
// execute order
_snapGas("OverrideAuctionTargetBlock");
_snapStart("OverrideAuctionTargetBlock");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();
}
Expand Down
6 changes: 3 additions & 3 deletions test/reactors/V2DutchOrderReactor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ contract V2DutchOrderTest is PermitSignature, DeployPermit2, BaseDutchOrderReact
SignedOrder memory signedOrder =
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order));

_snapGas("InputOverride");
_snapStart("InputOverride");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -311,7 +311,7 @@ contract V2DutchOrderTest is PermitSignature, DeployPermit2, BaseDutchOrderReact
SignedOrder memory signedOrder =
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order));

_snapGas("OutputOverride");
_snapStart("OutputOverride");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -377,7 +377,7 @@ contract V2DutchOrderTest is PermitSignature, DeployPermit2, BaseDutchOrderReact
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order));
vm.prank(address(1));

_snapGas("ExclusiveFiller");
_snapStart("ExclusiveFiller");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down
6 changes: 3 additions & 3 deletions test/reactors/V3DutchOrderReactor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ contract V3DutchOrderTest is PermitSignature, DeployPermit2, BaseReactorTest {
SignedOrder memory signedOrder =
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order));

_snapGas("V3-InputOverride");
_snapStart("V3-InputOverride");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -256,7 +256,7 @@ contract V3DutchOrderTest is PermitSignature, DeployPermit2, BaseReactorTest {
SignedOrder memory signedOrder =
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order));

_snapGas("V3-OutputOverride");
_snapStart("V3-OutputOverride");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down Expand Up @@ -326,7 +326,7 @@ contract V3DutchOrderTest is PermitSignature, DeployPermit2, BaseReactorTest {
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order));
vm.prank(address(1));

_snapGas("V3-ExclusiveFiller");
_snapStart("V3-ExclusiveFiller");
fillContract.execute(signedOrder);
vm.stopSnapshotGas();

Expand Down

0 comments on commit 55294fb

Please sign in to comment.