diff options
Diffstat (limited to 'packages')
37 files changed, 48 insertions, 110 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts index 6ad0a5888..e646bae78 100644 --- a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts @@ -185,6 +185,7 @@ export class ContractWrapper { this._unsubscribe(filterToken, err); }); } + // tslint:disable-next-line:no-unused-variable private _setNetworkId(networkId: number): void { this._networkId = networkId; } diff --git a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts index 3c7c97bcc..713d4d3f6 100644 --- a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts @@ -181,6 +181,7 @@ export class EtherTokenWrapper extends ContractWrapper { : networkSpecificArtifact.address; return contractAddressIfExists; } + // tslint:disable-next-line:no-unused-variable private _invalidateContractInstance(): void { this.unsubscribeAll(); this._etherTokenContractsByAddress = {}; diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index de2c64d23..2d5261900 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -885,6 +885,7 @@ export class ExchangeWrapper extends ContractWrapper { const contractAddress = this._getContractAddress(artifacts.ZRX, this._zrxContractAddressIfExists); return contractAddress; } + // tslint:disable:no-unused-variable private _invalidateContractInstances(): void { this.unsubscribeAll(); delete this._exchangeContractIfExists; @@ -916,6 +917,7 @@ export class ExchangeWrapper extends ContractWrapper { const orderHashHex = await exchangeInstance.getOrderHash.callAsync(orderAddresses, orderValues); return orderHashHex; } + // tslint:enable:no-unused-variable private async _getExchangeContractAsync(): Promise<ExchangeContract> { if (!_.isUndefined(this._exchangeContractIfExists)) { return this._exchangeContractIfExists; diff --git a/packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts index e75973658..fb9396281 100644 --- a/packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts @@ -108,6 +108,7 @@ export class TokenRegistryWrapper extends ContractWrapper { const contractAddress = this._getContractAddress(artifacts.TokenRegistry, this._contractAddressIfExists); return contractAddress; } + // tslint:disable-next-line:no-unused-variable private _invalidateContractInstance(): void { delete this._tokenRegistryContractIfExists; } diff --git a/packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts index 02a2e19d0..2fe3e6620 100644 --- a/packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts @@ -49,6 +49,7 @@ export class TokenTransferProxyWrapper extends ContractWrapper { const contractAddress = this._getContractAddress(artifacts.TokenTransferProxy, this._contractAddressIfExists); return contractAddress; } + // tslint:disable-next-line:no-unused-variable private _invalidateContractInstance(): void { delete this._tokenTransferProxyContractIfExists; } diff --git a/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts index de82a0252..ba1422b7e 100644 --- a/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts @@ -414,6 +414,7 @@ export class TokenWrapper extends ContractWrapper { ); return logs; } + // tslint:disable:no-unused-variable private _invalidateContractInstances(): void { this.unsubscribeAll(); this._tokenContractsByAddress = {}; diff --git a/packages/contract-wrappers/test/token_wrapper_test.ts b/packages/contract-wrappers/test/token_wrapper_test.ts index d0632bd5f..6cb1869fc 100644 --- a/packages/contract-wrappers/test/token_wrapper_test.ts +++ b/packages/contract-wrappers/test/token_wrapper_test.ts @@ -218,7 +218,6 @@ describe('TokenWrapper', () => { describe('With provider without accounts', () => { let zeroExContractWithoutAccounts: ContractWrappers; before(async () => { - const hasAddresses = false; const emptyWalletProvider = addEmptyWalletSubprovider(provider); zeroExContractWithoutAccounts = new ContractWrappers(emptyWalletProvider, config); }); @@ -361,7 +360,6 @@ describe('TokenWrapper', () => { describe('With provider without accounts', () => { let zeroExContractWithoutAccounts: ContractWrappers; before(async () => { - const hasAddresses = false; const emptyWalletProvider = addEmptyWalletSubprovider(provider); zeroExContractWithoutAccounts = new ContractWrappers(emptyWalletProvider, config); }); diff --git a/packages/contract-wrappers/tslint.json b/packages/contract-wrappers/tslint.json index ffaefe83a..1b88c370c 100644 --- a/packages/contract-wrappers/tslint.json +++ b/packages/contract-wrappers/tslint.json @@ -1,3 +1,6 @@ { - "extends": ["@0xproject/tslint-config"] + "extends": ["@0xproject/tslint-config"], + "linterOptions": { + "exclude": ["src/contract_wrappers/generated/*"] + } } diff --git a/packages/contracts/src/utils/coverage.ts b/packages/contracts/src/utils/coverage.ts index a37939464..41c83f703 100644 --- a/packages/contracts/src/utils/coverage.ts +++ b/packages/contracts/src/utils/coverage.ts @@ -1,6 +1,5 @@ import { devConstants } from '@0xproject/dev-utils'; import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov'; -import * as fs from 'fs'; import * as _ from 'lodash'; let coverageSubprovider: CoverageSubprovider; diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts index dd278e77c..ea8eb47c7 100644 --- a/packages/contracts/src/utils/exchange_wrapper.ts +++ b/packages/contracts/src/utils/exchange_wrapper.ts @@ -1,7 +1,7 @@ import { AssetProxyId, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import { LogEntry, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; +import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; import { ExchangeContract } from '../contract_wrappers/generated/exchange'; diff --git a/packages/contracts/src/utils/log_decoder.ts b/packages/contracts/src/utils/log_decoder.ts index 07d10e69d..79d41d2da 100644 --- a/packages/contracts/src/utils/log_decoder.ts +++ b/packages/contracts/src/utils/log_decoder.ts @@ -39,7 +39,7 @@ export class LogDecoder { } public decodeLogOrThrow<ArgsType extends DecodedLogArgs>(log: LogEntry): LogWithDecodedArgs<ArgsType> | RawLog { const logWithDecodedArgsOrLog = this._abiDecoder.tryToDecodeLogOrNoop(log); - if (_.isUndefined((logWithDecodedArgsOrLog as LogWithDecodedArgs<ArgsType>).args)) { + if (_.isUndefined((logWithDecodedArgsOrLog).args)) { throw new Error(`Unable to decode log: ${JSON.stringify(log)}`); } LogDecoder.wrapLogBigNumbers(logWithDecodedArgsOrLog); diff --git a/packages/contracts/src/utils/match_order_tester.ts b/packages/contracts/src/utils/match_order_tester.ts index 6170188bc..f4f7f965b 100644 --- a/packages/contracts/src/utils/match_order_tester.ts +++ b/packages/contracts/src/utils/match_order_tester.ts @@ -1,38 +1,21 @@ -import { BlockchainLifecycle } from '@0xproject/dev-utils'; -import { assetProxyUtils, crypto, orderHashUtils } from '@0xproject/order-utils'; +import { assetProxyUtils, orderHashUtils } from '@0xproject/order-utils'; import { AssetProxyId, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; -import { LogWithDecodedArgs } from 'ethereum-types'; -import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; -import { DummyERC20TokenContract } from '../contract_wrappers/generated/dummy_e_r_c20_token'; -import { DummyERC721TokenContract } from '../contract_wrappers/generated/dummy_e_r_c721_token'; -import { ERC20ProxyContract } from '../contract_wrappers/generated/e_r_c20_proxy'; -import { ERC721ProxyContract } from '../contract_wrappers/generated/e_r_c721_proxy'; -import { - CancelContractEventArgs, - ExchangeContract, - FillContractEventArgs, -} from '../contract_wrappers/generated/exchange'; import { chaiSetup } from '../utils/chai_setup'; -import { constants } from '../utils/constants'; import { ERC20Wrapper } from '../utils/erc20_wrapper'; import { ERC721Wrapper } from '../utils/erc721_wrapper'; import { ExchangeWrapper } from '../utils/exchange_wrapper'; -import { OrderFactory } from '../utils/order_factory'; import { - ContractName, ERC20BalancesByOwner, ERC721TokenIdsByOwner, TransferAmountsByMatchOrders as TransferAmounts, } from '../utils/types'; -import { provider, web3Wrapper } from '../utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); export class MatchOrderTester { private _exchangeWrapper: ExchangeWrapper; @@ -112,11 +95,6 @@ export class MatchOrderTester { initialTakerAssetFilledAmountLeft?: BigNumber, initialTakerAssetFilledAmountRight?: BigNumber, ): Promise<[ERC20BalancesByOwner, ERC721TokenIdsByOwner]> { - // Test setup & verify preconditions - const makerAddressLeft = signedOrderLeft.makerAddress; - const makerAddressRight = signedOrderRight.makerAddress; - const feeRecipientAddressLeft = signedOrderLeft.feeRecipientAddress; - const feeRecipientAddressRight = signedOrderRight.feeRecipientAddress; // Verify Left order preconditions const orderTakerAssetFilledAmountLeft = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( orderHashUtils.getOrderHashHex(signedOrderLeft), diff --git a/packages/contracts/src/utils/multi_sig_wrapper.ts b/packages/contracts/src/utils/multi_sig_wrapper.ts index 9971e8f6e..750466ce1 100644 --- a/packages/contracts/src/utils/multi_sig_wrapper.ts +++ b/packages/contracts/src/utils/multi_sig_wrapper.ts @@ -6,7 +6,6 @@ import * as _ from 'lodash'; import { AssetProxyOwnerContract } from '../contract_wrappers/generated/asset_proxy_owner'; import { MultiSigWalletContract } from '../contract_wrappers/generated/multi_sig_wallet'; -import { constants } from './constants'; import { LogDecoder } from './log_decoder'; export class MultiSigWrapper { diff --git a/packages/contracts/src/utils/order_factory.ts b/packages/contracts/src/utils/order_factory.ts index af411c01f..6e4c9a883 100644 --- a/packages/contracts/src/utils/order_factory.ts +++ b/packages/contracts/src/utils/order_factory.ts @@ -1,7 +1,6 @@ import { generatePseudoRandomSalt, orderHashUtils } from '@0xproject/order-utils'; import { Order, SignatureType, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; import { constants } from './constants'; import { signingUtils } from './signing_utils'; diff --git a/packages/contracts/src/utils/order_utils.ts b/packages/contracts/src/utils/order_utils.ts index 0d0329aa1..2a8791e4c 100644 --- a/packages/contracts/src/utils/order_utils.ts +++ b/packages/contracts/src/utils/order_utils.ts @@ -1,6 +1,5 @@ -import { Order, OrderWithoutExchangeAddress, SignedOrder } from '@0xproject/types'; +import { OrderWithoutExchangeAddress, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import ethUtil = require('ethereumjs-util'); import { CancelOrder, MatchOrder } from './types'; diff --git a/packages/contracts/src/utils/transaction_factory.ts b/packages/contracts/src/utils/transaction_factory.ts index 434611908..a060263b1 100644 --- a/packages/contracts/src/utils/transaction_factory.ts +++ b/packages/contracts/src/utils/transaction_factory.ts @@ -1,6 +1,5 @@ import { crypto, generatePseudoRandomSalt } from '@0xproject/order-utils'; import { SignatureType } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; import * as ethUtil from 'ethereumjs-util'; import { signingUtils } from './signing_utils'; diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts index 360e1fdbc..491890fa1 100644 --- a/packages/contracts/src/utils/types.ts +++ b/packages/contracts/src/utils/types.ts @@ -1,6 +1,6 @@ -import { Order, OrderWithoutExchangeAddress } from '@0xproject/types'; +import { OrderWithoutExchangeAddress } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import { AbiDefinition, ContractAbi } from 'ethereum-types'; +import { AbiDefinition } from 'ethereum-types'; export interface ERC20BalancesByOwner { [ownerAddress: string]: { diff --git a/packages/contracts/src/utils/web3_wrapper.ts b/packages/contracts/src/utils/web3_wrapper.ts index 1049ab967..95fb55753 100644 --- a/packages/contracts/src/utils/web3_wrapper.ts +++ b/packages/contracts/src/utils/web3_wrapper.ts @@ -1,7 +1,6 @@ import { devConstants, env, EnvVars, web3Factory } from '@0xproject/dev-utils'; import { prependSubprovider } from '@0xproject/subproviders'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import { Provider } from 'ethereum-types'; import { coverage } from './coverage'; diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts index e8274acb1..5f0c7f7ff 100644 --- a/packages/contracts/test/asset_proxy/authorizable.ts +++ b/packages/contracts/test/asset_proxy/authorizable.ts @@ -1,8 +1,6 @@ -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import * as chai from 'chai'; import 'make-promises-safe'; -import * as Web3 from 'web3'; import { MixinAuthorizableContract } from '../../src/contract_wrappers/generated/mixin_authorizable'; import { artifacts } from '../../src/utils/artifacts'; diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index faab39759..b6284a81e 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -1,10 +1,8 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { assetProxyUtils } from '@0xproject/order-utils'; -import { AssetProxyId } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; import { DummyERC20TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c20_token'; import { DummyERC721TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c721_token'; @@ -247,7 +245,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); await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.transferFrom.sendTransactionAsync( @@ -274,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(0); return expect( erc721Proxy.transferFrom.sendTransactionAsync( @@ -297,7 +293,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(500); return expect( erc721Proxy.transferFrom.sendTransactionAsync( diff --git a/packages/contracts/test/asset_proxy_owner.ts b/packages/contracts/test/asset_proxy_owner.ts index 4c16b5cff..efb948b5e 100644 --- a/packages/contracts/test/asset_proxy_owner.ts +++ b/packages/contracts/test/asset_proxy_owner.ts @@ -2,9 +2,7 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; -import * as _ from 'lodash'; import 'make-promises-safe'; -import * as Web3 from 'web3'; import { AssetProxyOwnerContract, @@ -23,7 +21,7 @@ import { provider, txDefaults, web3Wrapper } from '../src/utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); - +// tslint:disable:no-unnecessary-type-assertion describe('AssetProxyOwner', () => { let owners: string[]; let authorized: string; @@ -355,3 +353,4 @@ describe('AssetProxyOwner', () => { }); }); }); +// tslint:enable:no-unnecessary-type-assertion diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index 4e52b658f..0d6f2323d 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -1,5 +1,5 @@ -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; -import { BigNumber, promisify } from '@0xproject/utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; +import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import 'make-promises-safe'; diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 91ead93f0..009719eb3 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -1,5 +1,5 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; -import { assetProxyUtils, crypto, orderHashUtils } from '@0xproject/order-utils'; +import { assetProxyUtils, orderHashUtils } from '@0xproject/order-utils'; import { AssetProxyId, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -24,14 +24,13 @@ import { ERC20Wrapper } from '../../src/utils/erc20_wrapper'; import { ERC721Wrapper } from '../../src/utils/erc721_wrapper'; import { ExchangeWrapper } from '../../src/utils/exchange_wrapper'; import { OrderFactory } from '../../src/utils/order_factory'; -import { orderUtils } from '../../src/utils/order_utils'; -import { ContractName, ERC20BalancesByOwner, OrderStatus } from '../../src/utils/types'; +import { ERC20BalancesByOwner } from '../../src/utils/types'; import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); - +// tslint:disable:no-unnecessary-type-assertion describe('Exchange core', () => { let makerAddress: string; let owner: string; @@ -577,7 +576,6 @@ describe('Exchange core', () => { }); it('should log 1 event with correct arguments', async () => { - const divisor = 2; const res = await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress); expect(res.logs).to.have.length(1); @@ -724,6 +722,7 @@ describe('Exchange core', () => { expect(initialOwnerTakerAsset).to.be.bignumber.equal(takerAddress); // Call Exchange const takerAssetFillAmount = signedOrder.takerAssetAmount; + // tslint:disable-next-line:no-unused-variable const res = await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }); // Verify post-conditions const newOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -922,4 +921,6 @@ describe('Exchange core', () => { ); }); }); -}); // tslint:disable-line:max-file-line-count +}); +// tslint:disable:max-file-line-count +// tslint:enable:no-unnecessary-type-assertion diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts index 8bc66e3cf..dc7b8a648 100644 --- a/packages/contracts/test/exchange/dispatcher.ts +++ b/packages/contracts/test/exchange/dispatcher.ts @@ -3,7 +3,6 @@ import { assetProxyUtils } from '@0xproject/order-utils'; import { AssetProxyId } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; -import * as Web3 from 'web3'; import { DummyERC20TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c20_token'; import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c20_proxy'; @@ -23,7 +22,6 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('AssetProxyDispatcher', () => { let owner: string; let notOwner: string; - let notAuthorized: string; let makerAddress: string; let takerAddress: string; @@ -45,7 +43,6 @@ describe('AssetProxyDispatcher', () => { // Setup accounts & addresses const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, notOwner, makerAddress, takerAddress] = accounts); - notAuthorized = notOwner; erc20Wrapper = new ERC20Wrapper(provider, usedAddresses, owner); erc721Wrapper = new ERC721Wrapper(provider, usedAddresses, owner); @@ -305,7 +302,6 @@ describe('AssetProxyDispatcher', () => { // Construct metadata for ERC20 proxy const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); // Perform a transfer from makerAddress to takerAddress - const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(10); return expect( assetProxyDispatcher.publicDispatchTransferFrom.sendTransactionAsync( diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts index 10cb8b34e..8553e49c8 100644 --- a/packages/contracts/test/exchange/libs.ts +++ b/packages/contracts/test/exchange/libs.ts @@ -3,7 +3,6 @@ import { assetProxyUtils, orderHashUtils } from '@0xproject/order-utils'; import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; -import ethUtil = require('ethereumjs-util'); import { TestLibsContract } from '../../src/contract_wrappers/generated/test_libs'; import { addressUtils } from '../../src/utils/address_utils'; diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts index 24ee794bc..2363ba256 100644 --- a/packages/contracts/test/exchange/match_orders.ts +++ b/packages/contracts/test/exchange/match_orders.ts @@ -1,22 +1,16 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; -import { assetProxyUtils, crypto } from '@0xproject/order-utils'; -import { AssetProxyId, SignedOrder } from '@0xproject/types'; +import { assetProxyUtils } from '@0xproject/order-utils'; +import { AssetProxyId } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; -import { LogWithDecodedArgs } from 'ethereum-types'; -import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; import { DummyERC20TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c20_token'; import { DummyERC721TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c721_token'; import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c20_proxy'; import { ERC721ProxyContract } from '../../src/contract_wrappers/generated/e_r_c721_proxy'; -import { - CancelContractEventArgs, - ExchangeContract, - FillContractEventArgs, -} from '../../src/contract_wrappers/generated/exchange'; +import { ExchangeContract } from '../../src/contract_wrappers/generated/exchange'; import { artifacts } from '../../src/utils/artifacts'; import { chaiSetup } from '../../src/utils/chai_setup'; import { constants } from '../../src/utils/constants'; @@ -25,13 +19,7 @@ import { ERC721Wrapper } from '../../src/utils/erc721_wrapper'; import { ExchangeWrapper } from '../../src/utils/exchange_wrapper'; import { MatchOrderTester } from '../../src/utils/match_order_tester'; import { OrderFactory } from '../../src/utils/order_factory'; -import { - ContractName, - ERC20BalancesByOwner, - ERC721TokenIdsByOwner, - OrderInfo, - OrderStatus, -} from '../../src/utils/types'; +import { ERC20BalancesByOwner, ERC721TokenIdsByOwner, OrderInfo, OrderStatus } from '../../src/utils/types'; import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper'; chaiSetup.configure(); @@ -64,7 +52,6 @@ describe('matchOrders', () => { let erc721LeftMakerAssetIds: BigNumber[]; let erc721RightMakerAssetIds: BigNumber[]; - let erc721TakerAssetIds: BigNumber[]; let defaultERC20MakerAssetAddress: string; let defaultERC20TakerAssetAddress: string; @@ -103,7 +90,6 @@ describe('matchOrders', () => { const erc721Balances = await erc721Wrapper.getBalancesAsync(); erc721LeftMakerAssetIds = erc721Balances[makerAddressLeft][erc721Token.address]; erc721RightMakerAssetIds = erc721Balances[makerAddressRight][erc721Token.address]; - erc721TakerAssetIds = erc721Balances[takerAddress][erc721Token.address]; // Depoy exchange exchange = await ExchangeContract.deployFrom0xArtifactAsync( artifacts.Exchange, diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts index 936910ee9..bc3368d5f 100644 --- a/packages/contracts/test/exchange/signature_validator.ts +++ b/packages/contracts/test/exchange/signature_validator.ts @@ -1,7 +1,6 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { assetProxyUtils, orderHashUtils } from '@0xproject/order-utils'; import { SignedOrder } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import ethUtil = require('ethereumjs-util'); diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts index f31053ad3..16f65d19b 100644 --- a/packages/contracts/test/exchange/transactions.ts +++ b/packages/contracts/test/exchange/transactions.ts @@ -1,10 +1,8 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { assetProxyUtils, generatePseudoRandomSalt } from '@0xproject/order-utils'; -import { AssetProxyId, Order, OrderWithoutExchangeAddress, SignedOrder } from '@0xproject/types'; +import { AssetProxyId, OrderWithoutExchangeAddress, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; -import * as ethUtil from 'ethereumjs-util'; -import * as Web3 from 'web3'; import { DummyERC20TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c20_token'; import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c20_proxy'; @@ -18,7 +16,7 @@ import { ExchangeWrapper } from '../../src/utils/exchange_wrapper'; import { OrderFactory } from '../../src/utils/order_factory'; import { orderUtils } from '../../src/utils/order_utils'; import { TransactionFactory } from '../../src/utils/transaction_factory'; -import { ERC20BalancesByOwner, OrderStatus, SignedTransaction } from '../../src/utils/types'; +import { ERC20BalancesByOwner, SignedTransaction } from '../../src/utils/types'; import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper'; chaiSetup.configure(); diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 583ec9f91..9bc85c8b9 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -1,4 +1,4 @@ -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { assetProxyUtils } from '@0xproject/order-utils'; import { AssetProxyId, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; @@ -6,14 +6,12 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import * as _ from 'lodash'; import 'make-promises-safe'; -import * as Web3 from 'web3'; import { DummyERC20TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c20_token'; import { DummyERC721TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c721_token'; import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c20_proxy'; import { ERC721ProxyContract } from '../../src/contract_wrappers/generated/e_r_c721_proxy'; import { ExchangeContract } from '../../src/contract_wrappers/generated/exchange'; -import { TokenRegistryContract } from '../../src/contract_wrappers/generated/token_registry'; import { artifacts } from '../../src/utils/artifacts'; import { chaiSetup } from '../../src/utils/chai_setup'; import { constants } from '../../src/utils/constants'; diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts index 26cfa8291..c16b6f6bf 100644 --- a/packages/contracts/test/libraries/lib_bytes.ts +++ b/packages/contracts/test/libraries/lib_bytes.ts @@ -1,12 +1,8 @@ -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; -import { AssetProxyId } from '@0xproject/types'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; import BN = require('bn.js'); import * as chai from 'chai'; -import { LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import ethUtil = require('ethereumjs-util'); -import * as Web3 from 'web3'; import { TestLibBytesContract } from '../../src/contract_wrappers/generated/test_lib_bytes'; import { artifacts } from '../../src/utils/artifacts'; @@ -19,7 +15,6 @@ const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('LibBytes', () => { - let owner: string; let libBytes: TestLibBytesContract; const byteArrayShorterThan32Bytes = '0x012345'; const byteArrayShorterThan20Bytes = byteArrayShorterThan32Bytes; @@ -42,7 +37,6 @@ describe('LibBytes', () => { before(async () => { // Setup accounts & addresses const accounts = await web3Wrapper.getAvailableAddressesAsync(); - owner = accounts[0]; testAddress = accounts[1]; // Deploy LibBytes libBytes = await TestLibBytesContract.deployFrom0xArtifactAsync(artifacts.TestLibBytes, provider, txDefaults); diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index 1302d0fa0..afe7571af 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -1,11 +1,8 @@ -import { BlockchainLifecycle, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; -import * as _ from 'lodash'; import 'make-promises-safe'; -import * as Web3 from 'web3'; import { MultiSigWalletWithTimeLockContract, @@ -20,7 +17,7 @@ import { provider, txDefaults, web3Wrapper } from '../src/utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); - +// tslint:disable:no-unnecessary-type-assertion describe('MultiSigWalletWithTimeLock', () => { let owners: string[]; const REQUIRED_APPROVALS = new BigNumber(2); @@ -167,3 +164,4 @@ describe('MultiSigWalletWithTimeLock', () => { }); }); }); +// tslint:enable:no-unnecessary-type-assertion diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts index 64caac387..89dcba55f 100644 --- a/packages/contracts/test/token_registry.ts +++ b/packages/contracts/test/token_registry.ts @@ -1,11 +1,9 @@ -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber, NULL_BYTES } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; import 'make-promises-safe'; -import * as Web3 from 'web3'; import { TokenRegistryContract } from '../src/contract_wrappers/generated/token_registry'; import { artifacts } from '../src/utils/artifacts'; diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index b2acdebaa..d6bc3ddca 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -1,9 +1,7 @@ -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import 'make-promises-safe'; -import * as Web3 from 'web3'; import { DummyERC20TokenContract } from '../src/contract_wrappers/generated/dummy_e_r_c20_token'; import { artifacts } from '../src/utils/artifacts'; diff --git a/packages/contracts/test/zrx_token.ts b/packages/contracts/test/zrx_token.ts index fe37e802b..0dbafce69 100644 --- a/packages/contracts/test/zrx_token.ts +++ b/packages/contracts/test/zrx_token.ts @@ -1,9 +1,8 @@ -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import 'make-promises-safe'; -import * as Web3 from 'web3'; import { ZRXTokenContract } from '../src/contract_wrappers/generated/zrx_token'; import { artifacts } from '../src/utils/artifacts'; diff --git a/packages/contracts/tslint.json b/packages/contracts/tslint.json index 1ab924e47..216da0653 100644 --- a/packages/contracts/tslint.json +++ b/packages/contracts/tslint.json @@ -2,5 +2,8 @@ "extends": ["@0xproject/tslint-config"], "rules": { "custom-no-magic-numbers": false + }, + "linterOptions": { + "exclude": ["src/contract_wrappers/generated/*"] } } diff --git a/packages/fill-scenarios/tslint.json b/packages/fill-scenarios/tslint.json index 4da19578a..052613ddc 100644 --- a/packages/fill-scenarios/tslint.json +++ b/packages/fill-scenarios/tslint.json @@ -1,6 +1,6 @@ { "extends": ["@0xproject/tslint-config"], - "rules": { - "no-unused-variable": false + "linterOptions": { + "exclude": ["src/generated_contract_wrappers/*"] } } diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json index a7b630885..a3fb356c2 100644 --- a/packages/tslint-config/tslint.json +++ b/packages/tslint-config/tslint.json @@ -28,7 +28,6 @@ "interface-name": false, "interface-over-type-literal": true, "linebreak-style": [true, "LF"], - "max-classes-per-file": false, "max-classes-per-file": [true, 1], "max-line-length": false, "max-file-line-count": [true, 500], |