diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-23 06:19:06 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-24 05:13:37 +0800 |
commit | 010e6f8d7f7403cb91c020fc501fdb4f59861c58 (patch) | |
tree | 7f854bbf95efed9688f144943df7a8c326c3c65e /packages/0x.js/test | |
parent | 3d5b6ec110e32f670920a88939a250479651bb5a (diff) | |
download | dexon-sol-tools-010e6f8d7f7403cb91c020fc501fdb4f59861c58.tar.gz dexon-sol-tools-010e6f8d7f7403cb91c020fc501fdb4f59861c58.tar.zst dexon-sol-tools-010e6f8d7f7403cb91c020fc501fdb4f59861c58.zip |
Fix the imports order
Diffstat (limited to 'packages/0x.js/test')
-rw-r--r-- | packages/0x.js/test/0x.js_test.ts | 18 | ||||
-rw-r--r-- | packages/0x.js/test/artifacts_test.ts | 10 | ||||
-rw-r--r-- | packages/0x.js/test/assert_test.ts | 2 | ||||
-rw-r--r-- | packages/0x.js/test/ether_token_wrapper_test.ts | 12 | ||||
-rw-r--r-- | packages/0x.js/test/event_watcher_test.ts | 20 | ||||
-rw-r--r-- | packages/0x.js/test/exchange_transfer_simulator_test.ts | 14 | ||||
-rw-r--r-- | packages/0x.js/test/exchange_wrapper_test.ts | 36 | ||||
-rw-r--r-- | packages/0x.js/test/expiration_watcher_test.ts | 22 | ||||
-rw-r--r-- | packages/0x.js/test/order_validation_test.ts | 20 | ||||
-rw-r--r-- | packages/0x.js/test/subscription_test.ts | 26 | ||||
-rw-r--r-- | packages/0x.js/test/token_registry_wrapper_test.ts | 12 | ||||
-rw-r--r-- | packages/0x.js/test/token_transfer_proxy_wrapper_test.ts | 8 | ||||
-rw-r--r-- | packages/0x.js/test/token_wrapper_test.ts | 34 |
13 files changed, 130 insertions, 104 deletions
diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts index ba7a92fe4..cb4753248 100644 --- a/packages/0x.js/test/0x.js_test.ts +++ b/packages/0x.js/test/0x.js_test.ts @@ -1,14 +1,16 @@ -import * as _ from 'lodash'; +import BigNumber from 'bignumber.js'; import * as chai from 'chai'; -import {chaiSetup} from './utils/chai_setup'; +import * as _ from 'lodash'; import 'mocha'; -import BigNumber from 'bignumber.js'; import * as Sinon from 'sinon'; -import {ZeroEx, Order, ZeroExError, LogWithDecodedArgs, ApprovalContractEventArgs, TokenEvents} from '../src'; + +import {ApprovalContractEventArgs, LogWithDecodedArgs, Order, TokenEvents, ZeroEx, ZeroExError} from '../src'; + +import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {chaiSetup} from './utils/chai_setup'; import {constants} from './utils/constants'; import {TokenUtils} from './utils/token_utils'; import {web3Factory} from './utils/web3_factory'; -import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; const blockchainLifecycle = new BlockchainLifecycle(); chaiSetup.configure(); @@ -39,11 +41,11 @@ describe('ZeroEx library', () => { // Check that all nested web3 wrapper instances return the updated provider const nestedWeb3WrapperProvider = (zeroEx as any)._web3Wrapper.getCurrentProvider(); - expect((nestedWeb3WrapperProvider as any).zeroExTestId).to.be.a('number'); + expect((nestedWeb3WrapperProvider).zeroExTestId).to.be.a('number'); const exchangeWeb3WrapperProvider = (zeroEx.exchange as any)._web3Wrapper.getCurrentProvider(); - expect((exchangeWeb3WrapperProvider as any).zeroExTestId).to.be.a('number'); + expect((exchangeWeb3WrapperProvider).zeroExTestId).to.be.a('number'); const tokenRegistryWeb3WrapperProvider = (zeroEx.tokenRegistry as any)._web3Wrapper.getCurrentProvider(); - expect((tokenRegistryWeb3WrapperProvider as any).zeroExTestId).to.be.a('number'); + expect((tokenRegistryWeb3WrapperProvider).zeroExTestId).to.be.a('number'); }); }); describe('#isValidSignature', () => { diff --git a/packages/0x.js/test/artifacts_test.ts b/packages/0x.js/test/artifacts_test.ts index 265a71715..f4599a24d 100644 --- a/packages/0x.js/test/artifacts_test.ts +++ b/packages/0x.js/test/artifacts_test.ts @@ -1,8 +1,10 @@ -import * as fs from 'fs'; import * as chai from 'chai'; -import {chaiSetup} from './utils/chai_setup'; +import * as fs from 'fs'; import HDWalletProvider = require('truffle-hdwallet-provider'); + import {ZeroEx} from '../src'; + +import {chaiSetup} from './utils/chai_setup'; import {constants} from './utils/constants'; chaiSetup.configure(); @@ -26,7 +28,7 @@ describe('Artifacts', () => { await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync(); }).timeout(TIMEOUT); it('proxy contract is deployed', async () => { - await (zeroEx.token as any)._getTokenTransferProxyAddressAsync(); + await (zeroEx.proxy as any)._getTokenTransferProxyContractAsync(); }).timeout(TIMEOUT); it('exchange contract is deployed', async () => { await (zeroEx.exchange as any)._getExchangeContractAsync(); @@ -46,7 +48,7 @@ describe('Artifacts', () => { await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync(); }).timeout(TIMEOUT); it('proxy contract is deployed', async () => { - await (zeroEx.token as any)._getTokenTransferProxyAddressAsync(); + await (zeroEx.proxy as any)._getTokenTransferProxyContractAsync(); }).timeout(TIMEOUT); it('exchange contract is deployed', async () => { await (zeroEx.exchange as any)._getExchangeContractAsync(); diff --git a/packages/0x.js/test/assert_test.ts b/packages/0x.js/test/assert_test.ts index 628adceeb..9fa7f780f 100644 --- a/packages/0x.js/test/assert_test.ts +++ b/packages/0x.js/test/assert_test.ts @@ -1,7 +1,9 @@ import * as chai from 'chai'; import 'mocha'; + import {ZeroEx} from '../src'; import {assert} from '../src/utils/assert'; + import {constants} from './utils/constants'; import {web3Factory} from './utils/web3_factory'; diff --git a/packages/0x.js/test/ether_token_wrapper_test.ts b/packages/0x.js/test/ether_token_wrapper_test.ts index b86e79054..5b5e4c656 100644 --- a/packages/0x.js/test/ether_token_wrapper_test.ts +++ b/packages/0x.js/test/ether_token_wrapper_test.ts @@ -1,12 +1,14 @@ -import 'mocha'; +import BigNumber from 'bignumber.js'; import * as chai from 'chai'; -import {chaiSetup} from './utils/chai_setup'; +import 'mocha'; import * as Web3 from 'web3'; -import BigNumber from 'bignumber.js'; -import {web3Factory} from './utils/web3_factory'; -import {constants} from './utils/constants'; + import {ZeroEx, ZeroExError} from '../src'; + import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; +import {web3Factory} from './utils/web3_factory'; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/0x.js/test/event_watcher_test.ts b/packages/0x.js/test/event_watcher_test.ts index fc52d522a..f27a7da2c 100644 --- a/packages/0x.js/test/event_watcher_test.ts +++ b/packages/0x.js/test/event_watcher_test.ts @@ -1,20 +1,22 @@ -import 'mocha'; +import BigNumber from 'bignumber.js'; import * as chai from 'chai'; import * as _ from 'lodash'; +import 'mocha'; import * as Sinon from 'sinon'; import * as Web3 from 'web3'; -import BigNumber from 'bignumber.js'; -import {chaiSetup} from './utils/chai_setup'; -import {constants} from './utils/constants'; -import {web3Factory} from './utils/web3_factory'; -import {Web3Wrapper} from '../src/web3_wrapper'; -import {EventWatcher} from '../src/order_watcher/event_watcher'; + import { - ZeroEx, - LogEvent, DecodedLogEvent, + LogEvent, + ZeroEx, } from '../src'; +import {EventWatcher} from '../src/order_watcher/event_watcher'; import {DoneCallback} from '../src/types'; +import {Web3Wrapper} from '../src/web3_wrapper'; + +import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; +import {web3Factory} from './utils/web3_factory'; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/0x.js/test/exchange_transfer_simulator_test.ts b/packages/0x.js/test/exchange_transfer_simulator_test.ts index ad15f55fd..8e45b67a5 100644 --- a/packages/0x.js/test/exchange_transfer_simulator_test.ts +++ b/packages/0x.js/test/exchange_transfer_simulator_test.ts @@ -1,13 +1,15 @@ -import * as chai from 'chai'; import BigNumber from 'bignumber.js'; -import {chaiSetup} from './utils/chai_setup'; -import {web3Factory} from './utils/web3_factory'; -import {constants} from './utils/constants'; -import {ZeroEx, ExchangeContractErrs, Token} from '../src'; +import * as chai from 'chai'; + +import {ExchangeContractErrs, Token, ZeroEx} from '../src'; import {TradeSide, TransferType} from '../src/types'; -import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; +import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; +import {web3Factory} from './utils/web3_factory'; + chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(); diff --git a/packages/0x.js/test/exchange_wrapper_test.ts b/packages/0x.js/test/exchange_wrapper_test.ts index 8b89baa67..43dfeb425 100644 --- a/packages/0x.js/test/exchange_wrapper_test.ts +++ b/packages/0x.js/test/exchange_wrapper_test.ts @@ -1,28 +1,30 @@ -import 'mocha'; +import BigNumber from 'bignumber.js'; import * as chai from 'chai'; +import 'mocha'; import * as Web3 from 'web3'; -import BigNumber from 'bignumber.js'; -import {chaiSetup} from './utils/chai_setup'; -import {web3Factory} from './utils/web3_factory'; -import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; + import { - ZeroEx, - Token, - SignedOrder, - SubscriptionOpts, - ExchangeEvents, + DecodedLogEvent, ExchangeContractErrs, - OrderCancellationRequest, - OrderFillRequest, - LogFillContractEventArgs, + ExchangeEvents, LogCancelContractEventArgs, LogEvent, - DecodedLogEvent, + LogFillContractEventArgs, + OrderCancellationRequest, + OrderFillRequest, + SignedOrder, + SubscriptionOpts, + Token, + ZeroEx, } from '../src'; -import {DoneCallback, BlockParamLiteral} from '../src/types'; +import {BlockParamLiteral, DoneCallback} from '../src/types'; + +import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; import {FillScenarios} from './utils/fill_scenarios'; import {TokenUtils} from './utils/token_utils'; -import {constants} from './utils/constants'; +import {web3Factory} from './utils/web3_factory'; chaiSetup.configure(); const expect = chai.expect; @@ -825,4 +827,4 @@ describe('ExchangeWrapper', () => { expect(args.maker).to.be.equal(differentMakerAddress); }); }); -}); +}); // tslint:disable:max-file-line-count diff --git a/packages/0x.js/test/expiration_watcher_test.ts b/packages/0x.js/test/expiration_watcher_test.ts index 5b8848eba..c60b5dc6c 100644 --- a/packages/0x.js/test/expiration_watcher_test.ts +++ b/packages/0x.js/test/expiration_watcher_test.ts @@ -1,21 +1,23 @@ -import 'mocha'; +import BigNumber from 'bignumber.js'; import * as chai from 'chai'; import * as _ from 'lodash'; +import 'mocha'; import * as Sinon from 'sinon'; import * as Web3 from 'web3'; -import BigNumber from 'bignumber.js'; -import {chaiSetup} from './utils/chai_setup'; -import {web3Factory} from './utils/web3_factory'; -import {utils} from '../src/utils/utils'; + +import {ZeroEx} from '../src/0x'; +import {ExpirationWatcher} from '../src/order_watcher/expiration_watcher'; +import {DoneCallback, Token} from '../src/types'; import {constants} from '../src/utils/constants'; +import {utils} from '../src/utils/utils'; import {Web3Wrapper} from '../src/web3_wrapper'; -import {TokenUtils} from './utils/token_utils'; -import {ExpirationWatcher} from '../src/order_watcher/expiration_watcher'; -import {Token, DoneCallback} from '../src/types'; -import {ZeroEx} from '../src/0x'; + import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {chaiSetup} from './utils/chai_setup'; import {FillScenarios} from './utils/fill_scenarios'; import {reportCallbackErrors} from './utils/report_callback_errors'; +import {TokenUtils} from './utils/token_utils'; +import {web3Factory} from './utils/web3_factory'; chaiSetup.configure(); const expect = chai.expect; @@ -46,7 +48,7 @@ describe('ExpirationWatcher', () => { networkId: constants.TESTRPC_NETWORK_ID, }; zeroEx = new ZeroEx(web3.currentProvider, config); - exchangeContractAddress = await zeroEx.exchange.getContractAddress(); + exchangeContractAddress = zeroEx.exchange.getContractAddress(); userAddresses = await zeroEx.getAvailableAddressesAsync(); tokens = await zeroEx.tokenRegistry.getTokensAsync(); tokenUtils = new TokenUtils(tokens); diff --git a/packages/0x.js/test/order_validation_test.ts b/packages/0x.js/test/order_validation_test.ts index 3282ebb3e..e210c04a8 100644 --- a/packages/0x.js/test/order_validation_test.ts +++ b/packages/0x.js/test/order_validation_test.ts @@ -1,17 +1,19 @@ -import * as chai from 'chai'; -import * as Web3 from 'web3'; import BigNumber from 'bignumber.js'; +import * as chai from 'chai'; import * as Sinon from 'sinon'; -import {chaiSetup} from './utils/chai_setup'; -import {web3Factory} from './utils/web3_factory'; -import {ZeroEx, SignedOrder, Token, ExchangeContractErrs, ZeroExError} from '../src'; +import * as Web3 from 'web3'; + +import {ExchangeContractErrs, SignedOrder, Token, ZeroEx, ZeroExError} from '../src'; import {TradeSide, TransferType} from '../src/types'; -import {TokenUtils} from './utils/token_utils'; -import {constants} from './utils/constants'; +import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; +import {OrderValidationUtils} from '../src/utils/order_validation_utils'; + import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; import {FillScenarios} from './utils/fill_scenarios'; -import {OrderValidationUtils} from '../src/utils/order_validation_utils'; -import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; +import {TokenUtils} from './utils/token_utils'; +import {web3Factory} from './utils/web3_factory'; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/0x.js/test/subscription_test.ts b/packages/0x.js/test/subscription_test.ts index 9a436c1f2..df40ae75a 100644 --- a/packages/0x.js/test/subscription_test.ts +++ b/packages/0x.js/test/subscription_test.ts @@ -1,24 +1,26 @@ -import 'mocha'; -import * as _ from 'lodash'; +import BigNumber from 'bignumber.js'; import * as chai from 'chai'; +import promisify = require('es6-promisify'); +import * as _ from 'lodash'; +import 'mocha'; import * as Sinon from 'sinon'; -import {chaiSetup} from './utils/chai_setup'; import * as Web3 from 'web3'; -import BigNumber from 'bignumber.js'; -import promisify = require('es6-promisify'); -import {web3Factory} from './utils/web3_factory'; -import {constants} from './utils/constants'; + import { - ZeroEx, - ZeroExError, - Token, ApprovalContractEventArgs, - TokenEvents, DecodedLogEvent, + Token, + TokenEvents, + ZeroEx, + ZeroExError, } from '../src'; +import {BlockParamLiteral, DoneCallback} from '../src/types'; + import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; import {TokenUtils} from './utils/token_utils'; -import {DoneCallback, BlockParamLiteral} from '../src/types'; +import {web3Factory} from './utils/web3_factory'; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/0x.js/test/token_registry_wrapper_test.ts b/packages/0x.js/test/token_registry_wrapper_test.ts index fec5a5909..f1f307f3a 100644 --- a/packages/0x.js/test/token_registry_wrapper_test.ts +++ b/packages/0x.js/test/token_registry_wrapper_test.ts @@ -1,12 +1,14 @@ +import {schemas, SchemaValidator} from '@0xproject/json-schemas'; +import * as chai from 'chai'; import * as _ from 'lodash'; import 'mocha'; -import * as chai from 'chai'; -import {SchemaValidator, schemas} from '@0xproject/json-schemas'; -import {constants} from './utils/constants'; + +import {Token, ZeroEx} from '../src'; + +import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; import {web3Factory} from './utils/web3_factory'; -import {ZeroEx, Token} from '../src'; -import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/0x.js/test/token_transfer_proxy_wrapper_test.ts b/packages/0x.js/test/token_transfer_proxy_wrapper_test.ts index 3a6fc5403..05861d112 100644 --- a/packages/0x.js/test/token_transfer_proxy_wrapper_test.ts +++ b/packages/0x.js/test/token_transfer_proxy_wrapper_test.ts @@ -1,10 +1,12 @@ import * as chai from 'chai'; -import {chaiSetup} from './utils/chai_setup'; -import {web3Factory} from './utils/web3_factory'; + import {ZeroEx} from '../src'; -import {constants} from './utils/constants'; import {TokenTransferProxyWrapper} from '../src/contract_wrappers/token_transfer_proxy_wrapper'; +import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; +import {web3Factory} from './utils/web3_factory'; + chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/0x.js/test/token_wrapper_test.ts b/packages/0x.js/test/token_wrapper_test.ts index b07fed045..49af19a25 100644 --- a/packages/0x.js/test/token_wrapper_test.ts +++ b/packages/0x.js/test/token_wrapper_test.ts @@ -1,28 +1,30 @@ -import 'mocha'; -import * as chai from 'chai'; -import {chaiSetup} from './utils/chai_setup'; -import * as Web3 from 'web3'; import BigNumber from 'bignumber.js'; +import * as chai from 'chai'; import promisify = require('es6-promisify'); -import {web3Factory} from './utils/web3_factory'; +import 'mocha'; +import * as Web3 from 'web3'; + import { - ZeroEx, - ZeroExError, - Token, + ApprovalContractEventArgs, + ContractEvent, + DecodedLogEvent, + LogEvent, + LogWithDecodedArgs, SubscriptionOpts, + Token, + TokenContractEventArgs, TokenEvents, - ContractEvent, TransferContractEventArgs, - ApprovalContractEventArgs, - TokenContractEventArgs, - LogWithDecodedArgs, - LogEvent, - DecodedLogEvent, + ZeroEx, + ZeroExError, } from '../src'; -import {constants} from './utils/constants'; +import {BlockParamLiteral, DoneCallback} from '../src/types'; + import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {chaiSetup} from './utils/chai_setup'; +import {constants} from './utils/constants'; import {TokenUtils} from './utils/token_utils'; -import {DoneCallback, BlockParamLiteral} from '../src/types'; +import {web3Factory} from './utils/web3_factory'; chaiSetup.configure(); const expect = chai.expect; |