aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-06-09 02:43:47 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-06-09 02:43:47 +0800
commit05fbc8e6b061e5cef5bb8b8078176f9b375c2ec5 (patch)
treee297fae07dbbc43b107ba93e06e884aeb3958170 /packages/contracts/test
parentc39301b6da9f51ebccf11f06865c439ffed7f8f6 (diff)
downloaddexon-sol-tools-05fbc8e6b061e5cef5bb8b8078176f9b375c2ec5.tar.gz
dexon-sol-tools-05fbc8e6b061e5cef5bb8b8078176f9b375c2ec5.tar.zst
dexon-sol-tools-05fbc8e6b061e5cef5bb8b8078176f9b375c2ec5.zip
Linter changes to contracts
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/asset_proxy/decoder.ts8
-rw-r--r--packages/contracts/test/asset_proxy/proxies.ts6
-rw-r--r--packages/contracts/test/libraries/lib_bytes.ts7
-rw-r--r--packages/contracts/test/libraries/lib_mem.ts6
4 files changed, 6 insertions, 21 deletions
diff --git a/packages/contracts/test/asset_proxy/decoder.ts b/packages/contracts/test/asset_proxy/decoder.ts
index 41ea91648..d4fae1601 100644
--- a/packages/contracts/test/asset_proxy/decoder.ts
+++ b/packages/contracts/test/asset_proxy/decoder.ts
@@ -1,16 +1,12 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { assetProxyUtils, generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import ethUtil = require('ethereumjs-util');
-import * as Web3 from 'web3';
import { TestAssetDataDecodersContract } from '../../src/generated_contract_wrappers/test_asset_data_decoders';
import { artifacts } from '../../src/utils/artifacts';
import { chaiSetup } from '../../src/utils/chai_setup';
-import { constants } from '../../src/utils/constants';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
chaiSetup.configure();
@@ -18,7 +14,6 @@ const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe('TestAssetDataDecoders', () => {
- let owner: string;
let testAssetProxyDecoder: TestAssetDataDecodersContract;
let testAddress: string;
@@ -31,8 +26,7 @@ describe('TestAssetDataDecoders', () => {
before(async () => {
// Setup accounts & addresses
const accounts = await web3Wrapper.getAvailableAddressesAsync();
- owner = accounts[0];
- testAddress = accounts[1];
+ testAddress = accounts[0];
// Deploy TestLibMem
testAssetProxyDecoder = await TestAssetDataDecodersContract.deployFrom0xArtifactAsync(
artifacts.TestAssetDataDecoders,
diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts
index 50040092e..08376ccfb 100644
--- a/packages/contracts/test/asset_proxy/proxies.ts
+++ b/packages/contracts/test/asset_proxy/proxies.ts
@@ -1,6 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { assetProxyUtils, generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { AssetProxyId } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
@@ -28,6 +27,7 @@ chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
+// tslint:disable:no-unnecessary-type-assertion
describe('Asset Transfer Proxies', () => {
let owner: string;
let notAuthorized: string;
@@ -271,7 +271,6 @@ describe('Asset Transfer Proxies', () => {
const ownerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId);
expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress);
// Perform a transfer from makerAddress to takerAddress
- const erc20Balances = await erc20Wrapper.getBalancesAsync();
const amount = new BigNumber(1);
const txHash = await erc721Proxy.transferFrom.sendTransactionAsync(
encodedAssetData,
@@ -303,7 +302,6 @@ describe('Asset Transfer Proxies', () => {
const ownerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId);
expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress);
// Perform a transfer from makerAddress to takerAddress
- const erc20Balances = await erc20Wrapper.getBalancesAsync();
const amount = new BigNumber(1);
const txHash = await erc721Proxy.transferFrom.sendTransactionAsync(
encodedAssetData,
@@ -339,7 +337,6 @@ describe('Asset Transfer Proxies', () => {
const ownerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId);
expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress);
// Perform a transfer from makerAddress to takerAddress
- const erc20Balances = await erc20Wrapper.getBalancesAsync();
const amount = new BigNumber(1);
return expectRevertOrAlwaysFailingTransactionAsync(
erc721Proxy.transferFrom.sendTransactionAsync(
@@ -486,3 +483,4 @@ describe('Asset Transfer Proxies', () => {
});
});
});
+// tslint:enable:no-unnecessary-type-assertion
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts
index a3da5baac..2fefb7aeb 100644
--- a/packages/contracts/test/libraries/lib_bytes.ts
+++ b/packages/contracts/test/libraries/lib_bytes.ts
@@ -1,6 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { assetProxyUtils, generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { AssetProxyId } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import BN = require('bn.js');
import * as chai from 'chai';
@@ -8,7 +7,7 @@ import ethUtil = require('ethereumjs-util');
import { TestLibBytesContract } from '../../src/generated_contract_wrappers/test_lib_bytes';
import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync, expectRevertOrOtherErrorAsync } from '../../src/utils/assertions';
+import { expectRevertOrOtherErrorAsync } from '../../src/utils/assertions';
import { chaiSetup } from '../../src/utils/chai_setup';
import { constants } from '../../src/utils/constants';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
@@ -341,7 +340,6 @@ describe('LibBytes', () => {
it('should successfully read short, nested array of bytes when it is offset in the array', async () => {
const prefixByteArrayBuffer = ethUtil.toBuffer('0xabcdef');
- const shortDataAsBuffer = ethUtil.toBuffer(shortData);
const combinedByteArrayBuffer = Buffer.concat([prefixByteArrayBuffer, shortTestBytesAsBuffer]);
const combinedByteArray = ethUtil.bufferToHex(combinedByteArrayBuffer);
const testUint256Offset = new BigNumber(prefixByteArrayBuffer.byteLength);
@@ -357,7 +355,6 @@ describe('LibBytes', () => {
it('should successfully read a nested array of bytes - one word in length - when it is offset in the array', async () => {
const prefixByteArrayBuffer = ethUtil.toBuffer('0xabcdef');
- const wordOfDataAsBuffer = ethUtil.toBuffer(wordOfData);
const combinedByteArrayBuffer = Buffer.concat([prefixByteArrayBuffer, wordOfTestBytesAsBuffer]);
const combinedByteArray = ethUtil.bufferToHex(combinedByteArrayBuffer);
const testUint256Offset = new BigNumber(prefixByteArrayBuffer.byteLength);
@@ -373,7 +370,6 @@ describe('LibBytes', () => {
it('should successfully read long, nested array of bytes when it is offset in the array', async () => {
const prefixByteArrayBuffer = ethUtil.toBuffer('0xabcdef');
- const longDataAsBuffer = ethUtil.toBuffer(longData);
const combinedByteArrayBuffer = Buffer.concat([prefixByteArrayBuffer, longTestBytesAsBuffer]);
const combinedByteArray = ethUtil.bufferToHex(combinedByteArrayBuffer);
const testUint256Offset = new BigNumber(prefixByteArrayBuffer.byteLength);
@@ -510,3 +506,4 @@ describe('LibBytes', () => {
});
});
});
+// tslint:disable:max-file-line-count
diff --git a/packages/contracts/test/libraries/lib_mem.ts b/packages/contracts/test/libraries/lib_mem.ts
index 8682a36a4..90d54edcb 100644
--- a/packages/contracts/test/libraries/lib_mem.ts
+++ b/packages/contracts/test/libraries/lib_mem.ts
@@ -4,7 +4,7 @@ import * as chai from 'chai';
import { TestLibMemContract } from '../../src/generated_contract_wrappers/test_lib_mem';
import { artifacts } from '../../src/utils/artifacts';
import { chaiSetup } from '../../src/utils/chai_setup';
-import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
+import { provider, txDefaults } from '../../src/utils/web3_wrapper';
chaiSetup.configure();
const expect = chai.expect;
@@ -16,13 +16,9 @@ const toHex = (buf: Uint8Array): string => buf.reduce((a, v) => a + ('00' + v.to
const fromHex = (str: string): Uint8Array => Uint8Array.from(Buffer.from(str.slice(2), 'hex'));
describe('LibMem', () => {
- let owner: string;
let testLibMem: TestLibMemContract;
before(async () => {
- // Setup accounts & addresses
- const accounts = await web3Wrapper.getAvailableAddressesAsync();
- owner = accounts[0];
// Deploy TestLibMem
testLibMem = await TestLibMemContract.deployFrom0xArtifactAsync(artifacts.TestLibMem, provider, txDefaults);
});