From 87d34f9c7f3ccf22e01798c27c4a4d5d4f943816 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 22 Nov 2017 14:07:53 -0600 Subject: Auto-fix linter errors --- packages/0x.js/src/utils/abi_decoder.ts | 7 ++++--- packages/0x.js/src/utils/assert.ts | 11 ++++++----- packages/0x.js/src/utils/decorators.ts | 4 +++- .../0x.js/src/utils/exchange_transfer_simulator.ts | 5 +++-- packages/0x.js/src/utils/filter_utils.ts | 7 ++++--- packages/0x.js/src/utils/order_state_utils.ts | 23 +++++++++++----------- packages/0x.js/src/utils/order_validation_utils.ts | 10 ++++++---- packages/0x.js/src/utils/signature_utils.ts | 1 + packages/0x.js/src/utils/utils.ts | 7 ++++--- 9 files changed, 43 insertions(+), 32 deletions(-) (limited to 'packages/0x.js/src/utils') diff --git a/packages/0x.js/src/utils/abi_decoder.ts b/packages/0x.js/src/utils/abi_decoder.ts index df0fb2d6f..f027026da 100644 --- a/packages/0x.js/src/utils/abi_decoder.ts +++ b/packages/0x.js/src/utils/abi_decoder.ts @@ -1,9 +1,10 @@ -import * as Web3 from 'web3'; -import * as _ from 'lodash'; import BigNumber from 'bignumber.js'; -import {AbiType, DecodedLogArgs, LogWithDecodedArgs, RawLog, SolidityTypes, ContractEventArgs} from '../types'; +import * as _ from 'lodash'; +import * as Web3 from 'web3'; import * as SolidityCoder from 'web3/lib/solidity/coder'; +import {AbiType, ContractEventArgs, DecodedLogArgs, LogWithDecodedArgs, RawLog, SolidityTypes} from '../types'; + export class AbiDecoder { private savedABIs: Web3.AbiDefinition[] = []; private methodIds: {[signatureHash: string]: Web3.EventAbi} = {}; diff --git a/packages/0x.js/src/utils/assert.ts b/packages/0x.js/src/utils/assert.ts index 55912525c..3cff9d2cf 100644 --- a/packages/0x.js/src/utils/assert.ts +++ b/packages/0x.js/src/utils/assert.ts @@ -1,11 +1,12 @@ +import {assert as sharedAssert} from '@0xproject/assert'; +import {Schema, SchemaValidator} from '@0xproject/json-schemas'; +import BigNumber from 'bignumber.js'; import * as _ from 'lodash'; import * as Web3 from 'web3'; -import BigNumber from 'bignumber.js'; -import {SchemaValidator, Schema} from '@0xproject/json-schemas'; -import {assert as sharedAssert} from '@0xproject/assert'; -import {Web3Wrapper} from '../web3_wrapper'; -import {signatureUtils} from '../utils/signature_utils'; + import {ECSignature} from '../types'; +import {signatureUtils} from '../utils/signature_utils'; +import {Web3Wrapper} from '../web3_wrapper'; const HEX_REGEX = /^0x[0-9A-F]*$/i; diff --git a/packages/0x.js/src/utils/decorators.ts b/packages/0x.js/src/utils/decorators.ts index ec750b891..1760d8872 100644 --- a/packages/0x.js/src/utils/decorators.ts +++ b/packages/0x.js/src/utils/decorators.ts @@ -1,7 +1,9 @@ import * as _ from 'lodash'; -import {constants} from './constants'; + import {AsyncMethod, ZeroExError} from '../types'; +import {constants} from './constants'; + export const decorators = { /** * Source: https://stackoverflow.com/a/29837695/3546986 diff --git a/packages/0x.js/src/utils/exchange_transfer_simulator.ts b/packages/0x.js/src/utils/exchange_transfer_simulator.ts index cadded224..c3a2d1585 100644 --- a/packages/0x.js/src/utils/exchange_transfer_simulator.ts +++ b/packages/0x.js/src/utils/exchange_transfer_simulator.ts @@ -1,8 +1,9 @@ -import * as _ from 'lodash'; import BigNumber from 'bignumber.js'; -import {ExchangeContractErrs, TradeSide, TransferType, BlockParamLiteral} from '../types'; +import * as _ from 'lodash'; + import {TokenWrapper} from '../contract_wrappers/token_wrapper'; import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store'; +import {BlockParamLiteral, ExchangeContractErrs, TradeSide, TransferType} from '../types'; enum FailureReason { Balance = 'balance', diff --git a/packages/0x.js/src/utils/filter_utils.ts b/packages/0x.js/src/utils/filter_utils.ts index e09a95a6e..57c3ee71c 100644 --- a/packages/0x.js/src/utils/filter_utils.ts +++ b/packages/0x.js/src/utils/filter_utils.ts @@ -1,8 +1,9 @@ -import * as _ from 'lodash'; -import * as Web3 from 'web3'; -import * as uuid from 'uuid/v4'; import * as ethUtil from 'ethereumjs-util'; import * as jsSHA3 from 'js-sha3'; +import * as _ from 'lodash'; +import * as uuid from 'uuid/v4'; +import * as Web3 from 'web3'; + import {ContractEvents, IndexedFilterValues, SubscriptionOpts} from '../types'; const TOPIC_LENGTH = 32; diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts index 891849424..6654b9ae1 100644 --- a/packages/0x.js/src/utils/order_state_utils.ts +++ b/packages/0x.js/src/utils/order_state_utils.ts @@ -1,23 +1,24 @@ +import BigNumber from 'bignumber.js'; import * as _ from 'lodash'; import * as Web3 from 'web3'; -import BigNumber from 'bignumber.js'; + +import {ZeroEx} from '../0x'; +import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper'; +import {TokenWrapper} from '../contract_wrappers/token_wrapper'; +import {RemainingFillableCalculator} from '../order_watcher/remaining_fillable_calculator'; +import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store'; +import {OrderFilledCancelledLazyStore} from '../stores/order_filled_cancelled_lazy_store'; import { ExchangeContractErrs, - SignedOrder, - OrderRelevantState, MethodOpts, + OrderRelevantState, OrderState, - OrderStateValid, OrderStateInvalid, + OrderStateValid, + SignedOrder, } from '../types'; -import {ZeroEx} from '../0x'; -import {TokenWrapper} from '../contract_wrappers/token_wrapper'; -import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper'; -import {utils} from '../utils/utils'; import {constants} from '../utils/constants'; -import {OrderFilledCancelledLazyStore} from '../stores/order_filled_cancelled_lazy_store'; -import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store'; -import {RemainingFillableCalculator} from '../order_watcher/remaining_fillable_calculator'; +import {utils} from '../utils/utils'; const ACCEPTABLE_RELATIVE_ROUNDING_ERROR = 0.0001; diff --git a/packages/0x.js/src/utils/order_validation_utils.ts b/packages/0x.js/src/utils/order_validation_utils.ts index 4822f66e2..06cfca7bd 100644 --- a/packages/0x.js/src/utils/order_validation_utils.ts +++ b/packages/0x.js/src/utils/order_validation_utils.ts @@ -1,11 +1,13 @@ -import * as _ from 'lodash'; import BigNumber from 'bignumber.js'; -import {ExchangeContractErrs, SignedOrder, Order, ZeroExError, TradeSide, TransferType} from '../types'; +import * as _ from 'lodash'; + import {ZeroEx} from '../0x'; -import {TokenWrapper} from '../contract_wrappers/token_wrapper'; import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper'; -import {utils} from '../utils/utils'; +import {TokenWrapper} from '../contract_wrappers/token_wrapper'; +import {ExchangeContractErrs, Order, SignedOrder, TradeSide, TransferType, ZeroExError} from '../types'; import {constants} from '../utils/constants'; +import {utils} from '../utils/utils'; + import {ExchangeTransferSimulator} from './exchange_transfer_simulator'; export class OrderValidationUtils { diff --git a/packages/0x.js/src/utils/signature_utils.ts b/packages/0x.js/src/utils/signature_utils.ts index d066f8bf0..aaf04e7b0 100644 --- a/packages/0x.js/src/utils/signature_utils.ts +++ b/packages/0x.js/src/utils/signature_utils.ts @@ -1,4 +1,5 @@ import * as ethUtil from 'ethereumjs-util'; + import {ECSignature} from '../types'; export const signatureUtils = { diff --git a/packages/0x.js/src/utils/utils.ts b/packages/0x.js/src/utils/utils.ts index 5370c3b4b..04ae34aac 100644 --- a/packages/0x.js/src/utils/utils.ts +++ b/packages/0x.js/src/utils/utils.ts @@ -1,9 +1,10 @@ -import * as _ from 'lodash'; +import BigNumber from 'bignumber.js'; +import BN = require('bn.js'); import * as ethABI from 'ethereumjs-abi'; import * as ethUtil from 'ethereumjs-util'; +import * as _ from 'lodash'; + import {Order, SignedOrder, SolidityTypes} from '../types'; -import BigNumber from 'bignumber.js'; -import BN = require('bn.js'); export const utils = { /** -- cgit v1.2.3