From 744a9b89312c825ee94195106b9aa8aa11f43b77 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 25 Oct 2017 22:22:23 +0300 Subject: Upgrade bignumber to the version with native typings and remove typings --- test/utils/fill_scenarios.ts | 32 ++++++++++++++++---------------- test/utils/order_factory.ts | 12 ++++++------ 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'test/utils') diff --git a/test/utils/fill_scenarios.ts b/test/utils/fill_scenarios.ts index c399c7bf4..a0632b12c 100644 --- a/test/utils/fill_scenarios.ts +++ b/test/utils/fill_scenarios.ts @@ -1,4 +1,4 @@ -import * as BigNumber from 'bignumber.js'; +import BigNumber from 'bignumber.js'; import {ZeroEx, Token, SignedOrder} from '../../src'; import {orderFactory} from '../utils/order_factory'; import {constants} from './constants'; @@ -21,8 +21,8 @@ export class FillScenarios { } public async createFillableSignedOrderAsync(makerTokenAddress: string, takerTokenAddress: string, makerAddress: string, takerAddress: string, - fillableAmount: BigNumber.BigNumber, - expirationUnixTimestampSec?: BigNumber.BigNumber): + fillableAmount: BigNumber, + expirationUnixTimestampSec?: BigNumber): Promise { return this.createAsymmetricFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, @@ -31,10 +31,10 @@ export class FillScenarios { } public async createFillableSignedOrderWithFeesAsync( makerTokenAddress: string, takerTokenAddress: string, - makerFee: BigNumber.BigNumber, takerFee: BigNumber.BigNumber, + makerFee: BigNumber, takerFee: BigNumber, makerAddress: string, takerAddress: string, - fillableAmount: BigNumber.BigNumber, - feeRecepient: string, expirationUnixTimestampSec?: BigNumber.BigNumber, + fillableAmount: BigNumber, + feeRecepient: string, expirationUnixTimestampSec?: BigNumber, ): Promise { return this.createAsymmetricFillableSignedOrderWithFeesAsync( makerTokenAddress, takerTokenAddress, makerFee, takerFee, makerAddress, takerAddress, @@ -43,8 +43,8 @@ export class FillScenarios { } public async createAsymmetricFillableSignedOrderAsync( makerTokenAddress: string, takerTokenAddress: string, makerAddress: string, takerAddress: string, - makerFillableAmount: BigNumber.BigNumber, takerFillableAmount: BigNumber.BigNumber, - expirationUnixTimestampSec?: BigNumber.BigNumber): Promise { + makerFillableAmount: BigNumber, takerFillableAmount: BigNumber, + expirationUnixTimestampSec?: BigNumber): Promise { const makerFee = new BigNumber(0); const takerFee = new BigNumber(0); const feeRecepient = constants.NULL_ADDRESS; @@ -54,8 +54,8 @@ export class FillScenarios { ); } public async createPartiallyFilledSignedOrderAsync(makerTokenAddress: string, takerTokenAddress: string, - takerAddress: string, fillableAmount: BigNumber.BigNumber, - partialFillAmount: BigNumber.BigNumber) { + takerAddress: string, fillableAmount: BigNumber, + partialFillAmount: BigNumber) { const [makerAddress] = this.userAddresses; const signedOrder = await this.createAsymmetricFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, @@ -69,10 +69,10 @@ export class FillScenarios { } private async createAsymmetricFillableSignedOrderWithFeesAsync( makerTokenAddress: string, takerTokenAddress: string, - makerFee: BigNumber.BigNumber, takerFee: BigNumber.BigNumber, + makerFee: BigNumber, takerFee: BigNumber, makerAddress: string, takerAddress: string, - makerFillableAmount: BigNumber.BigNumber, takerFillableAmount: BigNumber.BigNumber, - feeRecepient: string, expirationUnixTimestampSec?: BigNumber.BigNumber): Promise { + makerFillableAmount: BigNumber, takerFillableAmount: BigNumber, + feeRecepient: string, expirationUnixTimestampSec?: BigNumber): Promise { await Promise.all([ this.increaseBalanceAndAllowanceAsync(makerTokenAddress, makerAddress, makerFillableAmount), @@ -90,7 +90,7 @@ export class FillScenarios { return signedOrder; } private async increaseBalanceAndAllowanceAsync( - tokenAddress: string, address: string, amount: BigNumber.BigNumber): Promise { + tokenAddress: string, address: string, amount: BigNumber): Promise { if (amount.isZero() || address === ZeroEx.NULL_ADDRESS) { return; // noop } @@ -100,11 +100,11 @@ export class FillScenarios { ]); } private async increaseBalanceAsync( - tokenAddress: string, address: string, amount: BigNumber.BigNumber): Promise { + tokenAddress: string, address: string, amount: BigNumber): Promise { await this.zeroEx.token.transferAsync(tokenAddress, this.coinbase, address, amount); } private async increaseAllowanceAsync( - tokenAddress: string, address: string, amount: BigNumber.BigNumber): Promise { + tokenAddress: string, address: string, amount: BigNumber): Promise { const oldMakerAllowance = await this.zeroEx.token.getProxyAllowanceAsync(tokenAddress, address); const newMakerAllowance = oldMakerAllowance.plus(amount); await this.zeroEx.token.setProxyAllowanceAsync( diff --git a/test/utils/order_factory.ts b/test/utils/order_factory.ts index fc4adebd9..6086e09f7 100644 --- a/test/utils/order_factory.ts +++ b/test/utils/order_factory.ts @@ -1,5 +1,5 @@ import * as _ from 'lodash'; -import * as BigNumber from 'bignumber.js'; +import BigNumber from 'bignumber.js'; import {ZeroEx, SignedOrder} from '../../src'; export const orderFactory = { @@ -7,15 +7,15 @@ export const orderFactory = { zeroEx: ZeroEx, maker: string, taker: string, - makerFee: BigNumber.BigNumber, - takerFee: BigNumber.BigNumber, - makerTokenAmount: BigNumber.BigNumber, + makerFee: BigNumber, + takerFee: BigNumber, + makerTokenAmount: BigNumber, makerTokenAddress: string, - takerTokenAmount: BigNumber.BigNumber, + takerTokenAmount: BigNumber, takerTokenAddress: string, exchangeContractAddress: string, feeRecipient: string, - expirationUnixTimestampSec?: BigNumber.BigNumber): Promise { + expirationUnixTimestampSec?: BigNumber): Promise { const defaultExpirationUnixTimestampSec = new BigNumber(2524604400); // Close to infinite expirationUnixTimestampSec = _.isUndefined(expirationUnixTimestampSec) ? defaultExpirationUnixTimestampSec : -- cgit v1.2.3