Skip to content

Commit 50d4262

Browse files
committed
linter
1 parent 4f87a3d commit 50d4262

File tree

6 files changed

+24
-27
lines changed

6 files changed

+24
-27
lines changed

.eslintignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
node_modules/
2-
truffle-config.js
3-
js/
4-
test/helpers
5-
coverage/
2+
coverage/

test/ChainLinkExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe('ChainLinkExample', async function () {
142142
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
143143

144144
await expect(
145-
this.swap.fillOrder(order, signature, '0x', makingAmount, 0, takingAmount.add(ether('0.01'))) // taking threshold = exact taker amount + eps
145+
this.swap.fillOrder(order, signature, '0x', makingAmount, 0, takingAmount.add(ether('0.01'))), // taking threshold = exact taker amount + eps
146146
).to.eventually.be.rejectedWith('PredicateIsNotTrue()');
147147
});
148148

test/LimitOrderProtocol.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('LimitOrderProtocol', async function () {
6565
);
6666

6767
await expect(
68-
this.swap.fillOrder(sentOrder, signature, '0x', 1, 0, 1)
68+
this.swap.fillOrder(sentOrder, signature, '0x', 1, 0, 1),
6969
).to.eventually.be.rejectedWith('BadSignature()');
7070
});
7171

@@ -83,7 +83,7 @@ describe('LimitOrderProtocol', async function () {
8383
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
8484

8585
await expect(
86-
this.swap.fillOrder(order, signature, '0x', 1, 1, 1)
86+
this.swap.fillOrder(order, signature, '0x', 1, 1, 1),
8787
).to.eventually.be.rejectedWith('OnlyOneAmountShouldBeZero()');
8888
});
8989

@@ -101,7 +101,7 @@ describe('LimitOrderProtocol', async function () {
101101
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
102102

103103
await expect(
104-
this.swap.fillOrder(order, signature, '0x', 2, 0, 1)
104+
this.swap.fillOrder(order, signature, '0x', 2, 0, 1),
105105
).to.eventually.be.rejectedWith('TakingAmountTooHigh()');
106106
});
107107

@@ -119,7 +119,7 @@ describe('LimitOrderProtocol', async function () {
119119
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
120120

121121
await expect(
122-
this.swap.fillOrder(order, signature, '0x', 0, 2, 3)
122+
this.swap.fillOrder(order, signature, '0x', 0, 2, 3),
123123
).to.eventually.be.rejectedWith('MakingAmountTooLow()');
124124
});
125125

@@ -255,7 +255,7 @@ describe('LimitOrderProtocol', async function () {
255255
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
256256

257257
await expect(
258-
this.swap.fillOrder(order, signature, '0x', 0, 4, 0)
258+
this.swap.fillOrder(order, signature, '0x', 0, 4, 0),
259259
).to.eventually.be.rejectedWith('SwapWithZeroAmount()');
260260
});
261261

@@ -401,7 +401,7 @@ describe('LimitOrderProtocol', async function () {
401401
const permit = await getPermit(addr0, otherWallet.getPrivateKey(), this.weth, '1', this.chainId, swap.address, '1');
402402
const targetPermitPair = withTarget(this.weth.address, permit);
403403
await expect(
404-
swap.fillOrderToWithPermit(order, signature, '0x', 0, 1, 1, addr0, targetPermitPair)
404+
swap.fillOrderToWithPermit(order, signature, '0x', 0, 1, 1, addr0, targetPermitPair),
405405
).to.eventually.be.rejectedWith('ERC20Permit: invalid signature');
406406
});
407407

@@ -422,7 +422,7 @@ describe('LimitOrderProtocol', async function () {
422422
const permit = await getPermit(addr0, addr1Wallet.getPrivateKey(), this.weth, '1', this.chainId, swap.address, '1', deadline);
423423
const targetPermitPair = withTarget(this.weth.address, permit);
424424
await expect(
425-
swap.fillOrderToWithPermit(order, signature, '0x', 0, 1, 1, addr0, targetPermitPair)
425+
swap.fillOrderToWithPermit(order, signature, '0x', 0, 1, 1, addr0, targetPermitPair),
426426
).to.eventually.be.rejectedWith('expired deadline');
427427
});
428428
});
@@ -468,7 +468,7 @@ describe('LimitOrderProtocol', async function () {
468468
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
469469

470470
await expect(
471-
this.swap.fillOrder(order, signature, '0x', 5, 0, 5)
471+
this.swap.fillOrder(order, signature, '0x', 5, 0, 5),
472472
).to.eventually.be.rejectedWith('WrongAmount()');
473473
});
474474

@@ -511,7 +511,7 @@ describe('LimitOrderProtocol', async function () {
511511
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
512512

513513
await expect(
514-
this.swap.fillOrder(order, signature, '0x', 0, 5, 5)
514+
this.swap.fillOrder(order, signature, '0x', 0, 5, 5),
515515
).to.eventually.be.rejectedWith('WrongAmount()');
516516
});
517517
});
@@ -538,7 +538,7 @@ describe('LimitOrderProtocol', async function () {
538538

539539
it('should not cancel foreign order', async function () {
540540
await expect(
541-
this.swap.cancelOrder(this.order)
541+
this.swap.cancelOrder(this.order),
542542
).to.eventually.be.rejectedWith('AccessDenied()');
543543
});
544544

@@ -548,7 +548,7 @@ describe('LimitOrderProtocol', async function () {
548548
await this.swap.cancelOrder(this.order, { from: addr1 });
549549

550550
await expect(
551-
this.swap.fillOrder(this.order, signature, '0x', 1, 0, 1)
551+
this.swap.fillOrder(this.order, signature, '0x', 1, 0, 1),
552552
).to.eventually.be.rejectedWith('RemainingAmountIsZero()');
553553
});
554554
});
@@ -672,7 +672,7 @@ describe('LimitOrderProtocol', async function () {
672672
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
673673

674674
await expect(
675-
this.swap.fillOrder(order, signature, '0x', 1, 0, 1)
675+
this.swap.fillOrder(order, signature, '0x', 1, 0, 1),
676676
).to.eventually.be.rejectedWith('PredicateIsNotTrue()');
677677
});
678678

@@ -779,7 +779,7 @@ describe('LimitOrderProtocol', async function () {
779779
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
780780

781781
await expect(
782-
this.swap.fillOrder(order, signature, '0x', 1, 0, 1)
782+
this.swap.fillOrder(order, signature, '0x', 1, 0, 1),
783783
).to.eventually.be.rejectedWith('PredicateIsNotTrue()');
784784
});
785785
});
@@ -831,7 +831,7 @@ describe('LimitOrderProtocol', async function () {
831831
const signature = signOrder(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
832832

833833
await expect(
834-
this.swap.fillOrder(order, signature, '0x', 1, 0, 1)
834+
this.swap.fillOrder(order, signature, '0x', 1, 0, 1),
835835
).to.eventually.be.rejectedWith('PredicateIsNotTrue()');
836836
});
837837

test/RfqOrders.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe('RFQ Orders in LimitOrderProtocol', async function () {
174174
await this.swap.cancelOrderRFQ('1', { from: addr1 });
175175

176176
await expect(
177-
this.swap.fillOrderRFQ(order, signature, 1, 0)
177+
this.swap.fillOrderRFQ(order, signature, 1, 0),
178178
).to.eventually.be.rejectedWith('InvalidatedOrder()');
179179
});
180180

@@ -186,7 +186,7 @@ describe('RFQ Orders in LimitOrderProtocol', async function () {
186186

187187
const { r, vs } = compactSignature(signature);
188188
await expect(
189-
this.swap.fillOrderRFQCompact(order, r, vs, 1)
189+
this.swap.fillOrderRFQCompact(order, r, vs, 1),
190190
).to.eventually.be.rejectedWith('InvalidatedOrder()');
191191
});
192192
});
@@ -302,7 +302,7 @@ describe('RFQ Orders in LimitOrderProtocol', async function () {
302302
const signature = signOrderRFQ(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
303303

304304
await expect(
305-
this.swap.fillOrderRFQ(order, signature, 0, 1)
305+
this.swap.fillOrderRFQ(order, signature, 0, 1),
306306
).to.eventually.be.rejectedWith('SwapWithZeroAmount()');
307307
});
308308

@@ -312,7 +312,7 @@ describe('RFQ Orders in LimitOrderProtocol', async function () {
312312

313313
const { r, vs } = compactSignature(signature);
314314
await expect(
315-
this.swap.fillOrderRFQCompact(order, r, vs, 1)
315+
this.swap.fillOrderRFQCompact(order, r, vs, 1),
316316
).to.eventually.be.rejectedWith('RFQSwapWithZeroAmount()');
317317
});
318318

@@ -321,7 +321,7 @@ describe('RFQ Orders in LimitOrderProtocol', async function () {
321321
const signature = signOrderRFQ(order, this.chainId, this.swap.address, addr1Wallet.getPrivateKey());
322322

323323
await expect(
324-
this.swap.fillOrderRFQ(order, signature, 1, 0)
324+
this.swap.fillOrderRFQ(order, signature, 1, 0),
325325
).to.eventually.be.rejectedWith('OrderExpired()');
326326
});
327327

@@ -331,7 +331,7 @@ describe('RFQ Orders in LimitOrderProtocol', async function () {
331331

332332
const { r, vs } = compactSignature(signature);
333333
await expect(
334-
this.swap.fillOrderRFQCompact(order, r, vs, 1)
334+
this.swap.fillOrderRFQCompact(order, r, vs, 1),
335335
).to.eventually.be.rejectedWith('OrderExpired()');
336336
});
337337
});

test/helpers/orderUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function buildOrder (
8080
const interactions = '0x' + allInteractions.map(a => a.substring(2)).join('');
8181

8282
// https://stackoverflow.com/a/55261098/440168
83-
const cumulativeSum = (sum => value => sum += value)(0);
83+
const cumulativeSum = (sum => value => { sum += value; return sum; })(0);
8484
const offsets = allInteractions
8585
.map(a => a.length / 2 - 1)
8686
.map(cumulativeSum)

test/helpers/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function cutLastArg (data, padding = 0) {
2727

2828
function joinStaticCalls (targets, datas) {
2929
const data = datas.map((d, i) => trim0x(targets[i]) + trim0x(d));
30-
const cumulativeSum = (sum => value => sum += value)(0);
30+
const cumulativeSum = (sum => value => { sum += value; return sum; })(0);
3131
return {
3232
offsets: data
3333
.map(d => d.length / 2)

0 commit comments

Comments
 (0)