diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-23 04:07:53 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-24 05:13:37 +0800 |
commit | 87d34f9c7f3ccf22e01798c27c4a4d5d4f943816 (patch) | |
tree | e92510af5e9f1504acbfda424a59bf4facd0249d /packages/0x.js/src/contract_wrappers | |
parent | d20926e150beed4785b31451a415bbf545f850be (diff) | |
download | dexon-sol-tools-87d34f9c7f3ccf22e01798c27c4a4d5d4f943816.tar dexon-sol-tools-87d34f9c7f3ccf22e01798c27c4a4d5d4f943816.tar.gz dexon-sol-tools-87d34f9c7f3ccf22e01798c27c4a4d5d4f943816.tar.bz2 dexon-sol-tools-87d34f9c7f3ccf22e01798c27c4a4d5d4f943816.tar.lz dexon-sol-tools-87d34f9c7f3ccf22e01798c27c4a4d5d4f943816.tar.xz dexon-sol-tools-87d34f9c7f3ccf22e01798c27c4a4d5d4f943816.tar.zst dexon-sol-tools-87d34f9c7f3ccf22e01798c27c4a4d5d4f943816.zip |
Auto-fix linter errors
Diffstat (limited to 'packages/0x.js/src/contract_wrappers')
6 files changed, 70 insertions, 59 deletions
diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts index 93912c3d9..2b99cfe4c 100644 --- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts @@ -1,24 +1,25 @@ +import {Block, BlockAndLogStreamer} from 'ethereumjs-blockstream'; import * as _ from 'lodash'; import * as Web3 from 'web3'; -import {BlockAndLogStreamer, Block} from 'ethereumjs-blockstream'; -import {Web3Wrapper} from '../web3_wrapper'; -import {AbiDecoder} from '../utils/abi_decoder'; + import { - ZeroExError, - InternalZeroExError, Artifact, + BlockParamLiteral, + ContractEventArgs, + ContractEvents, + EventCallback, + IndexedFilterValues, + InternalZeroExError, LogWithDecodedArgs, RawLog, - ContractEvents, SubscriptionOpts, - IndexedFilterValues, - EventCallback, - BlockParamLiteral, - ContractEventArgs, + ZeroExError, } from '../types'; +import {AbiDecoder} from '../utils/abi_decoder'; import {constants} from '../utils/constants'; -import {intervalUtils} from '../utils/interval_utils'; import {filterUtils} from '../utils/filter_utils'; +import {intervalUtils} from '../utils/interval_utils'; +import {Web3Wrapper} from '../web3_wrapper'; export class ContractWrapper { protected _web3Wrapper: Web3Wrapper; diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index 9867e9a23..0ac21cb78 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -1,11 +1,13 @@ -import * as _ from 'lodash'; import BigNumber from 'bignumber.js'; +import * as _ from 'lodash'; + +import {artifacts} from '../artifacts'; +import {EtherTokenContract, ZeroExError} from '../types'; +import {assert} from '../utils/assert'; import {Web3Wrapper} from '../web3_wrapper'; + import {ContractWrapper} from './contract_wrapper'; import {TokenWrapper} from './token_wrapper'; -import {EtherTokenContract, ZeroExError} from '../types'; -import {assert} from '../utils/assert'; -import {artifacts} from '../artifacts'; /** * This class includes all the functionality related to interacting with a wrapped Ether ERC20 token contract. @@ -89,7 +91,7 @@ export class EtherTokenWrapper extends ContractWrapper { const contractInstance = await this._instantiateContractIfExistsAsync<EtherTokenContract>( artifacts.EtherTokenArtifact, this._contractAddressIfExists, ); - this._etherTokenContractIfExists = contractInstance as EtherTokenContract; + this._etherTokenContractIfExists = contractInstance; return this._etherTokenContractIfExists; } } diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts index 604c53e3a..97ea54362 100644 --- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts @@ -1,44 +1,46 @@ +import {schemas} from '@0xproject/json-schemas'; +import BigNumber from 'bignumber.js'; import * as _ from 'lodash'; import * as Web3 from 'web3'; -import BigNumber from 'bignumber.js'; -import {schemas} from '@0xproject/json-schemas'; -import {Web3Wrapper} from '../web3_wrapper'; + +import {artifacts} from '../artifacts'; import { + DecodedLogArgs, ECSignature, + EventCallback, ExchangeContract, ExchangeContractErrCodes, ExchangeContractErrs, - ZeroExError, - OrderValues, - OrderAddresses, - Order, - SignedOrder, + ExchangeContractEventArgs, ExchangeEvents, - SubscriptionOpts, IndexedFilterValues, - OrderCancellationRequest, - OrderFillRequest, + LogCancelContractEventArgs, LogErrorContractEventArgs, LogFillContractEventArgs, - LogCancelContractEventArgs, LogWithDecodedArgs, MethodOpts, - ValidateOrderFillableOpts, + Order, + OrderAddresses, + OrderCancellationRequest, + OrderFillRequest, OrderTransactionOpts, + OrderValues, RawLog, - EventCallback, - ExchangeContractEventArgs, - DecodedLogArgs, + SignedOrder, + SubscriptionOpts, + ValidateOrderFillableOpts, + ZeroExError, } from '../types'; +import {AbiDecoder} from '../utils/abi_decoder'; import {assert} from '../utils/assert'; -import {utils} from '../utils/utils'; +import {decorators} from '../utils/decorators'; +import {ExchangeTransferSimulator} from '../utils/exchange_transfer_simulator'; import {OrderValidationUtils} from '../utils/order_validation_utils'; +import {utils} from '../utils/utils'; +import {Web3Wrapper} from '../web3_wrapper'; + import {ContractWrapper} from './contract_wrapper'; import {TokenWrapper} from './token_wrapper'; -import {decorators} from '../utils/decorators'; -import {AbiDecoder} from '../utils/abi_decoder'; -import {ExchangeTransferSimulator} from '../utils/exchange_transfer_simulator'; -import {artifacts} from '../artifacts'; const SHOULD_VALIDATE_BY_DEFAULT = true; @@ -873,7 +875,7 @@ export class ExchangeWrapper extends ContractWrapper { const contractInstance = await this._instantiateContractIfExistsAsync<ExchangeContract>( artifacts.ExchangeArtifact, this._contractAddressIfExists, ); - this._exchangeContractIfExists = contractInstance as ExchangeContract; + this._exchangeContractIfExists = contractInstance; return this._exchangeContractIfExists; } private async _getTokenTransferProxyAddressAsync(): Promise<string> { diff --git a/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts index 50871d3f2..60fe7f33a 100644 --- a/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts @@ -1,10 +1,12 @@ import * as _ from 'lodash'; -import {Web3Wrapper} from '../web3_wrapper'; + +import {artifacts} from '../artifacts'; +import {Token, TokenMetadata, TokenRegistryContract, ZeroExError} from '../types'; import {assert} from '../utils/assert'; -import {Token, TokenRegistryContract, TokenMetadata, ZeroExError} from '../types'; import {constants} from '../utils/constants'; +import {Web3Wrapper} from '../web3_wrapper'; + import {ContractWrapper} from './contract_wrapper'; -import {artifacts} from '../artifacts'; /** * This class includes all the functionality related to interacting with the 0x Token Registry smart contract. @@ -123,7 +125,7 @@ export class TokenRegistryWrapper extends ContractWrapper { const contractInstance = await this._instantiateContractIfExistsAsync<TokenRegistryContract>( artifacts.TokenRegistryArtifact, this._contractAddressIfExists, ); - this._tokenRegistryContractIfExists = contractInstance as TokenRegistryContract; + this._tokenRegistryContractIfExists = contractInstance; return this._tokenRegistryContractIfExists; } } diff --git a/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts index 6970d5433..33adc0a9b 100644 --- a/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts @@ -1,8 +1,10 @@ import * as _ from 'lodash'; -import {Web3Wrapper} from '../web3_wrapper'; -import {ContractWrapper} from './contract_wrapper'; + import {artifacts} from '../artifacts'; import {TokenTransferProxyContract, ZeroExError} from '../types'; +import {Web3Wrapper} from '../web3_wrapper'; + +import {ContractWrapper} from './contract_wrapper'; /** * This class includes the functionality related to interacting with the TokenTransferProxy contract. @@ -60,7 +62,7 @@ export class TokenTransferProxyWrapper extends ContractWrapper { const contractInstance = await this._instantiateContractIfExistsAsync<TokenTransferProxyContract>( artifacts.TokenTransferProxyArtifact, this._contractAddressIfExists, ); - this._tokenTransferProxyContractIfExists = contractInstance as TokenTransferProxyContract; + this._tokenTransferProxyContractIfExists = contractInstance; return this._tokenTransferProxyContractIfExists; } } diff --git a/packages/0x.js/src/contract_wrappers/token_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_wrapper.ts index 5fd3a2a5d..4b359d069 100644 --- a/packages/0x.js/src/contract_wrappers/token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/token_wrapper.ts @@ -1,23 +1,25 @@ -import * as _ from 'lodash'; -import BigNumber from 'bignumber.js'; import {schemas} from '@0xproject/json-schemas'; -import {Web3Wrapper} from '../web3_wrapper'; -import {assert} from '../utils/assert'; -import {constants} from '../utils/constants'; -import {ContractWrapper} from './contract_wrapper'; -import {AbiDecoder} from '../utils/abi_decoder'; +import BigNumber from 'bignumber.js'; +import * as _ from 'lodash'; + import {artifacts} from '../artifacts'; import { - TokenContract, - ZeroExError, - TokenEvents, + EventCallback, IndexedFilterValues, - SubscriptionOpts, - MethodOpts, LogWithDecodedArgs, - EventCallback, + MethodOpts, + SubscriptionOpts, + TokenContract, TokenContractEventArgs, + TokenEvents, + ZeroExError, } from '../types'; +import {AbiDecoder} from '../utils/abi_decoder'; +import {assert} from '../utils/assert'; +import {constants} from '../utils/constants'; +import {Web3Wrapper} from '../web3_wrapper'; + +import {ContractWrapper} from './contract_wrapper'; const ALLOWANCE_TO_ZERO_GAS_AMOUNT = 47275; @@ -302,7 +304,7 @@ export class TokenWrapper extends ContractWrapper { const contractInstance = await this._instantiateContractIfExistsAsync<TokenContract>( artifacts.TokenArtifact, tokenAddress, ); - tokenContract = contractInstance as TokenContract; + tokenContract = contractInstance; this._tokenContractsByAddress[tokenAddress] = tokenContract; return tokenContract; } |