diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-17 20:07:44 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-05-17 20:07:44 +0800 |
commit | cf7967e6296aac0a328143e92a22c5682541a576 (patch) | |
tree | f413e35218ec48f58d4cb0fbe35bde5643358614 | |
parent | 0eacbac8f69bf3b5f03029aae338f63462ca3154 (diff) | |
download | dexon-sol-tools-cf7967e6296aac0a328143e92a22c5682541a576.tar dexon-sol-tools-cf7967e6296aac0a328143e92a22c5682541a576.tar.gz dexon-sol-tools-cf7967e6296aac0a328143e92a22c5682541a576.tar.bz2 dexon-sol-tools-cf7967e6296aac0a328143e92a22c5682541a576.tar.lz dexon-sol-tools-cf7967e6296aac0a328143e92a22c5682541a576.tar.xz dexon-sol-tools-cf7967e6296aac0a328143e92a22c5682541a576.tar.zst dexon-sol-tools-cf7967e6296aac0a328143e92a22c5682541a576.zip |
Disable magic number rule in more places where it isn't helping code readability
-rw-r--r-- | packages/contract-wrappers/test/order_validation_test.ts | 20 | ||||
-rw-r--r-- | packages/sol-cov/test/collect_coverage_entries_test.ts | 8 |
2 files changed, 14 insertions, 14 deletions
diff --git a/packages/contract-wrappers/test/order_validation_test.ts b/packages/contract-wrappers/test/order_validation_test.ts index ed2159026..d9077d6e4 100644 --- a/packages/contract-wrappers/test/order_validation_test.ts +++ b/packages/contract-wrappers/test/order_validation_test.ts @@ -207,8 +207,8 @@ describe('OrderValidation', () => { takerAddress, fillableAmount, ); - const sixthIndex = 6; - const nonTakerAddress = userAddresses[sixthIndex]; + // tslint:disable-next-line:custom-no-magic-numbers + const nonTakerAddress = userAddresses[6]; return expect( contractWrappers.exchange.validateFillOrderThrowIfInvalidAsync( signedOrder, @@ -355,8 +355,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - const expectedCallCount = 4; - expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); + // tslint:disable-next-line:custom-no-magic-numbers + expect(transferFromAsync.callCount).to.be.equal(4); expect( transferFromAsync .getCall(0) @@ -426,8 +426,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - const expectedCallCount = 4; - expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); + // tslint:disable-next-line:custom-no-magic-numbers + expect(transferFromAsync.callCount).to.be.equal(4); expect( transferFromAsync .getCall(0) @@ -495,8 +495,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - const expectedCallCount = 4; - expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); + // tslint:disable-next-line:custom-no-magic-numbers + expect(transferFromAsync.callCount).to.be.equal(4); const makerFillAmount = transferFromAsync.getCall(0).args[3]; expect(makerFillAmount).to.be.bignumber.equal(makerTokenAmount); }); @@ -523,8 +523,8 @@ describe('OrderValidation', () => { ); const makerPartialFee = makerFee.div(2); const takerPartialFee = takerFee.div(2); - const expectedCallCount = 4; - expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); + // tslint:disable-next-line:custom-no-magic-numbers + expect(transferFromAsync.callCount).to.be.equal(4); const partialMakerFee = transferFromAsync.getCall(2).args[3]; expect(partialMakerFee).to.be.bignumber.equal(makerPartialFee); const partialTakerFee = transferFromAsync.getCall(3).args[3]; diff --git a/packages/sol-cov/test/collect_coverage_entries_test.ts b/packages/sol-cov/test/collect_coverage_entries_test.ts index f60a57cb7..4263ed197 100644 --- a/packages/sol-cov/test/collect_coverage_entries_test.ts +++ b/packages/sol-cov/test/collect_coverage_entries_test.ts @@ -39,15 +39,15 @@ describe('Collect coverage entries', () => { const coverageEntries = collectCoverageEntries(simpleStorageContract); const fnIds = _.keys(coverageEntries.fnMap); expect(coverageEntries.fnMap[fnIds[0]].name).to.be.equal('set'); - const setExpectedLineNumber = 5; - expect(coverageEntries.fnMap[fnIds[0]].line).to.be.equal(setExpectedLineNumber); + // tslint:disable-next-line:custom-no-magic-numbers + expect(coverageEntries.fnMap[fnIds[0]].line).to.be.equal(5); const setFunction = `function set(uint x) { storedData = x; }`; expect(getRange(simpleStorageContract, coverageEntries.fnMap[fnIds[0]].loc)).to.be.equal(setFunction); expect(coverageEntries.fnMap[fnIds[1]].name).to.be.equal('get'); - const getExpectedLineNumber = 8; - expect(coverageEntries.fnMap[fnIds[1]].line).to.be.equal(getExpectedLineNumber); + // tslint:disable-next-line:custom-no-magic-numbers + expect(coverageEntries.fnMap[fnIds[1]].line).to.be.equal(8); const getFunction = `function get() constant returns (uint retVal) { return storedData; }`; |