diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-23 00:04:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-23 00:04:50 +0800 |
commit | cc840a6911850856c3254f7ac73cd70c527e1a5c (patch) | |
tree | c7435ac7ce09541a67f0106a85f391dc48921e10 /packages/contracts | |
parent | a26cc7c14d4e59102d5f84d534f75c42b8683cad (diff) | |
parent | c4a2f700172e8be367225d90a1c51cef8cf0d7dd (diff) | |
download | dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.gz dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.bz2 dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.lz dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.xz dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.zst dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.zip |
Merge pull request #594 from 0xProject/improvement/addCustomTslintRules
Add more tslint rules
Diffstat (limited to 'packages/contracts')
-rw-r--r-- | packages/contracts/test/exchange/helpers.ts | 8 | ||||
-rw-r--r-- | packages/contracts/test/unlimited_allowance_token.ts | 4 | ||||
-rw-r--r-- | packages/contracts/test/zrx_token.ts | 4 | ||||
-rw-r--r-- | packages/contracts/tslint.json | 5 |
4 files changed, 12 insertions, 9 deletions
diff --git a/packages/contracts/test/exchange/helpers.ts b/packages/contracts/test/exchange/helpers.ts index c3b947983..6d779b52a 100644 --- a/packages/contracts/test/exchange/helpers.ts +++ b/packages/contracts/test/exchange/helpers.ts @@ -124,21 +124,21 @@ describe('Exchange', () => { }); it('should return true with a valid signature', async () => { - const success = await exchangeWrapper.isValidSignatureAsync(signedOrder); + const isValidSignatureForContract = await exchangeWrapper.isValidSignatureAsync(signedOrder); const orderHashHex = ZeroEx.getOrderHashHex(signedOrder); const isValidSignature = ZeroEx.isValidSignature(orderHashHex, signedOrder.ecSignature, signedOrder.maker); expect(isValidSignature).to.be.true(); - expect(success).to.be.true(); + expect(isValidSignatureForContract).to.be.true(); }); it('should return false with an invalid signature', async () => { signedOrder.ecSignature.r = ethUtil.bufferToHex(ethUtil.sha3('invalidR')); signedOrder.ecSignature.s = ethUtil.bufferToHex(ethUtil.sha3('invalidS')); - const success = await exchangeWrapper.isValidSignatureAsync(signedOrder); + const isValidSignatureForContract = await exchangeWrapper.isValidSignatureAsync(signedOrder); const orderHashHex = ZeroEx.getOrderHashHex(signedOrder); const isValidSignature = ZeroEx.isValidSignature(orderHashHex, signedOrder.ecSignature, signedOrder.maker); expect(isValidSignature).to.be.false(); - expect(success).to.be.false(); + expect(isValidSignatureForContract).to.be.false(); }); }); diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index 2b9ac9efa..1bb207558 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -100,8 +100,8 @@ describe('UnlimitedAllowanceToken', () => { const amountToTransfer = ownerBalance; const spenderAllowance = await zeroEx.token.getAllowanceAsync(tokenAddress, owner, spender); - const spenderAllowanceIsInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; - expect(spenderAllowanceIsInsufficient).to.be.true(); + const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; + expect(isSpenderAllowanceInsufficient).to.be.true(); return expect( token.transferFrom.callAsync(owner, spender, amountToTransfer, { diff --git a/packages/contracts/test/zrx_token.ts b/packages/contracts/test/zrx_token.ts index 27e876d7f..63c40f0e7 100644 --- a/packages/contracts/test/zrx_token.ts +++ b/packages/contracts/test/zrx_token.ts @@ -118,8 +118,8 @@ describe('ZRXToken', () => { const amountToTransfer = ownerBalance; const spenderAllowance = await zeroEx.token.getAllowanceAsync(zrxAddress, owner, spender); - const spenderAllowanceIsInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; - expect(spenderAllowanceIsInsufficient).to.be.true(); + const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; + expect(isSpenderAllowanceInsufficient).to.be.true(); const didReturnTrue = await zrx.transferFrom.callAsync(owner, spender, amountToTransfer, { from: spender }); expect(didReturnTrue).to.be.false(); diff --git a/packages/contracts/tslint.json b/packages/contracts/tslint.json index ffaefe83a..1ab924e47 100644 --- a/packages/contracts/tslint.json +++ b/packages/contracts/tslint.json @@ -1,3 +1,6 @@ { - "extends": ["@0xproject/tslint-config"] + "extends": ["@0xproject/tslint-config"], + "rules": { + "custom-no-magic-numbers": false + } } |