Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Dec 15, 2023
1 parent 469c682 commit a85519f
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions test/LimitOrderProtocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@ describe('LimitOrderProtocol', function () {
['address', 'bytes'],
[weth.address, permit],
),
swap.interface.encodeFunctionData('fillOrderArgs', [order, r, vs, 1, takerTraits.traits, takerTraits.args]),
swap.interface.encodeFunctionData('fillOrderArgs', [
order, r, vs, 1, takerTraits.traits, takerTraits.args,
]),
);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [1, -1]);
await expect(fillTx).to.changeTokenBalances(weth, [addr, addr1], [-1, 1]);
Expand All @@ -556,7 +558,9 @@ describe('LimitOrderProtocol', function () {
['address', 'bytes'],
[weth.address, permit],
),
swap.interface.encodeFunctionData('fillOrderArgs', [order, r, vs, 1, takerTraits.traits, takerTraits.args]),
swap.interface.encodeFunctionData('fillOrderArgs', [
order, r, vs, 1, takerTraits.traits, takerTraits.args,
]),
);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [1, -1]);
await expect(fillTx).to.changeTokenBalances(weth, [addr, addr1], [-1, 1]);
Expand All @@ -577,7 +581,9 @@ describe('LimitOrderProtocol', function () {
['address', 'bytes'],
[weth.address, permit],
),
swap.interface.encodeFunctionData('fillOrderArgs', [order, r, vs, 1, takerTraits.traits, takerTraits.args]),
swap.interface.encodeFunctionData('fillOrderArgs', [
order, r, vs, 1, takerTraits.traits, takerTraits.args,
]),
)).to.be.revertedWithCustomError(swap, 'TransferFromTakerToMakerFailed');
});
});
Expand Down Expand Up @@ -634,7 +640,9 @@ describe('LimitOrderProtocol', function () {
makingAmount: true,
extension: order.extension,
});
await expect(swap.connect(addr1).fillOrderArgs(order, r, vs, 1, takerTraits.traits, takerTraits.args)).to.be.revertedWithCustomError(swap, 'TransferFromMakerToTakerFailed');
await expect(swap.connect(addr1).fillOrderArgs(
order, r, vs, 1, takerTraits.traits, takerTraits.args,
)).to.be.revertedWithCustomError(swap, 'TransferFromMakerToTakerFailed');
});

it('skips order permit flag', async function () {
Expand Down Expand Up @@ -680,7 +688,9 @@ describe('LimitOrderProtocol', function () {
['address', 'bytes'],
[weth.address, permit],
),
swap.interface.encodeFunctionData('fillOrderArgs', [order, r, vs, 1, takerTraits.traits, takerTraits.args]),
swap.interface.encodeFunctionData('fillOrderArgs', [
order, r, vs, 1, takerTraits.traits, takerTraits.args,
]),
);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [1, -1]);
await expect(fillTx).to.changeTokenBalances(weth, [addr, addr1], [-1, 1]);
Expand Down Expand Up @@ -714,7 +724,9 @@ describe('LimitOrderProtocol', function () {
['address', 'bytes'],
[weth.address, permitExpired],
),
swap.interface.encodeFunctionData('fillOrderArgs', [order, r, vs, 1, takerTraits.traits, takerTraits.args]),
swap.interface.encodeFunctionData('fillOrderArgs', [
order, r, vs, 1, takerTraits.traits, takerTraits.args,
]),
);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [1, -1]);
await expect(fillTx).to.changeTokenBalances(weth, [addr, addr1], [-1, 1]);
Expand All @@ -738,7 +750,9 @@ describe('LimitOrderProtocol', function () {
['address', 'bytes'],
[weth.address, permit],
),
swap.interface.encodeFunctionData('fillOrderArgs', [order, r, vs, 1, takerTraits.traits, takerTraits.args]),
swap.interface.encodeFunctionData('fillOrderArgs', [
order, r, vs, 1, takerTraits.traits, takerTraits.args,
]),
)).to.be.revertedWithCustomError(swap, 'SafeTransferFromFailed');
});

Expand Down Expand Up @@ -840,7 +854,9 @@ describe('LimitOrderProtocol', function () {
makingAmount: true,
extension: order.extension,
});
await expect(swap.connect(addr1).fillOrderArgs(order, r, vs, 1, takerTraits.traits, takerTraits.args)).to.be.revertedWithCustomError(swap, 'SafeTransferFromFailed');
await expect(swap.connect(addr1).fillOrderArgs(
order, r, vs, 1, takerTraits.traits, takerTraits.args,
)).to.be.revertedWithCustomError(swap, 'SafeTransferFromFailed');
});

it('Fails with unexpected makerAssetSuffix', async function () {
Expand Down

0 comments on commit a85519f

Please sign in to comment.