aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-26 03:22:23 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-10-26 03:22:23 +0800
commit744a9b89312c825ee94195106b9aa8aa11f43b77 (patch)
tree29009ec3e75e9d0396e744993065c05ef04c650b /test
parent45c4042e2bb6d4c13510a5922602ba49bb5108ef (diff)
downloaddexon-sol-tools-744a9b89312c825ee94195106b9aa8aa11f43b77.tar
dexon-sol-tools-744a9b89312c825ee94195106b9aa8aa11f43b77.tar.gz
dexon-sol-tools-744a9b89312c825ee94195106b9aa8aa11f43b77.tar.bz2
dexon-sol-tools-744a9b89312c825ee94195106b9aa8aa11f43b77.tar.lz
dexon-sol-tools-744a9b89312c825ee94195106b9aa8aa11f43b77.tar.xz
dexon-sol-tools-744a9b89312c825ee94195106b9aa8aa11f43b77.tar.zst
dexon-sol-tools-744a9b89312c825ee94195106b9aa8aa11f43b77.zip
Upgrade bignumber to the version with native typings and remove typings
Diffstat (limited to 'test')
-rw-r--r--test/0x.js_test.ts2
-rw-r--r--test/ether_token_wrapper_test.ts4
-rw-r--r--test/exchange_transfer_simulator_test.ts2
-rw-r--r--test/exchange_wrapper_test.ts8
-rw-r--r--test/order_validation_test.ts6
-rw-r--r--test/token_wrapper_test.ts4
-rw-r--r--test/utils/fill_scenarios.ts32
-rw-r--r--test/utils/order_factory.ts12
8 files changed, 35 insertions, 35 deletions
diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts
index dd5dd19b1..d56acc38b 100644
--- a/test/0x.js_test.ts
+++ b/test/0x.js_test.ts
@@ -2,7 +2,7 @@ import * as _ from 'lodash';
import * as chai from 'chai';
import {chaiSetup} from './utils/chai_setup';
import 'mocha';
-import * as BigNumber from 'bignumber.js';
+import BigNumber from 'bignumber.js';
import * as Sinon from 'sinon';
import {ZeroEx, Order, ZeroExError, LogWithDecodedArgs, ApprovalContractEventArgs, TokenEvents} from '../src';
import {constants} from './utils/constants';
diff --git a/test/ether_token_wrapper_test.ts b/test/ether_token_wrapper_test.ts
index 389ec1619..ba679d1a1 100644
--- a/test/ether_token_wrapper_test.ts
+++ b/test/ether_token_wrapper_test.ts
@@ -2,7 +2,7 @@ import 'mocha';
import * as chai from 'chai';
import {chaiSetup} from './utils/chai_setup';
import * as Web3 from 'web3';
-import * as BigNumber from 'bignumber.js';
+import BigNumber from 'bignumber.js';
import {web3Factory} from './utils/web3_factory';
import {ZeroEx, ZeroExError} from '../src';
import {BlockchainLifecycle} from './utils/blockchain_lifecycle';
@@ -23,7 +23,7 @@ describe('EtherTokenWrapper', () => {
let userAddresses: string[];
let addressWithETH: string;
let wethContractAddress: string;
- let depositWeiAmount: BigNumber.BigNumber;
+ let depositWeiAmount: BigNumber;
let decimalPlaces: number;
const gasPrice = new BigNumber(1);
const zeroExConfig = {
diff --git a/test/exchange_transfer_simulator_test.ts b/test/exchange_transfer_simulator_test.ts
index ee24f4fe4..3373ebf03 100644
--- a/test/exchange_transfer_simulator_test.ts
+++ b/test/exchange_transfer_simulator_test.ts
@@ -1,5 +1,5 @@
import * as chai from 'chai';
-import * as BigNumber from 'bignumber.js';
+import BigNumber from 'bignumber.js';
import {chaiSetup} from './utils/chai_setup';
import {web3Factory} from './utils/web3_factory';
import {ZeroEx, ExchangeContractErrs, Token} from '../src';
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index f3f16643e..7c76499d5 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -1,7 +1,7 @@
import 'mocha';
import * as chai from 'chai';
import * as Web3 from 'web3';
-import * as BigNumber from 'bignumber.js';
+import BigNumber from 'bignumber.js';
import {chaiSetup} from './utils/chai_setup';
import {web3Factory} from './utils/web3_factory';
import {BlockchainLifecycle} from './utils/blockchain_lifecycle';
@@ -545,8 +545,8 @@ describe('ExchangeWrapper', () => {
let makerTokenAddress: string;
let takerTokenAddress: string;
let takerAddress: string;
- let fillableAmount: BigNumber.BigNumber;
- let partialFillAmount: BigNumber.BigNumber;
+ let fillableAmount: BigNumber;
+ let partialFillAmount: BigNumber;
let signedOrder: SignedOrder;
let orderHash: string;
before(() => {
@@ -621,7 +621,7 @@ describe('ExchangeWrapper', () => {
let coinbase: string;
let takerAddress: string;
let makerAddress: string;
- let fillableAmount: BigNumber.BigNumber;
+ let fillableAmount: BigNumber;
let signedOrder: SignedOrder;
const takerTokenFillAmountInBaseUnits = new BigNumber(1);
const cancelTakerAmountInBaseUnits = new BigNumber(1);
diff --git a/test/order_validation_test.ts b/test/order_validation_test.ts
index dfcf1d43d..4f18742d3 100644
--- a/test/order_validation_test.ts
+++ b/test/order_validation_test.ts
@@ -1,6 +1,6 @@
import * as chai from 'chai';
import * as Web3 from 'web3';
-import * as BigNumber from 'bignumber.js';
+import BigNumber from 'bignumber.js';
import * as Sinon from 'sinon';
import {chaiSetup} from './utils/chai_setup';
import {web3Factory} from './utils/web3_factory';
@@ -211,8 +211,8 @@ describe('OrderValidation', () => {
describe('#validateFillOrderBalancesAllowancesThrowIfInvalidAsync', () => {
let exchangeTransferSimulator: ExchangeTransferSimulator;
let transferFromAsync: Sinon.SinonSpy;
- const bigNumberMatch = (expected: BigNumber.BigNumber) => {
- return Sinon.match((value: BigNumber.BigNumber) => value.eq(expected));
+ const bigNumberMatch = (expected: BigNumber) => {
+ return Sinon.match((value: BigNumber) => value.eq(expected));
};
beforeEach('create exchangeTransferSimulator', async () => {
exchangeTransferSimulator = new ExchangeTransferSimulator(zeroEx.token);
diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts
index f1f6543b7..b35fa43f9 100644
--- a/test/token_wrapper_test.ts
+++ b/test/token_wrapper_test.ts
@@ -2,7 +2,7 @@ import 'mocha';
import * as chai from 'chai';
import {chaiSetup} from './utils/chai_setup';
import * as Web3 from 'web3';
-import * as BigNumber from 'bignumber.js';
+import BigNumber from 'bignumber.js';
import promisify = require('es6-promisify');
import {web3Factory} from './utils/web3_factory';
import {
@@ -51,7 +51,7 @@ describe('TokenWrapper', () => {
});
describe('#transferAsync', () => {
let token: Token;
- let transferAmount: BigNumber.BigNumber;
+ let transferAmount: BigNumber;
before(() => {
token = tokens[0];
transferAmount = new BigNumber(42);
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<SignedOrder> {
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<SignedOrder> {
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<SignedOrder> {
+ makerFillableAmount: BigNumber, takerFillableAmount: BigNumber,
+ expirationUnixTimestampSec?: BigNumber): Promise<SignedOrder> {
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<SignedOrder> {
+ makerFillableAmount: BigNumber, takerFillableAmount: BigNumber,
+ feeRecepient: string, expirationUnixTimestampSec?: BigNumber): Promise<SignedOrder> {
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<void> {
+ tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
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<void> {
+ tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
await this.zeroEx.token.transferAsync(tokenAddress, this.coinbase, address, amount);
}
private async increaseAllowanceAsync(
- tokenAddress: string, address: string, amount: BigNumber.BigNumber): Promise<void> {
+ tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
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<SignedOrder> {
+ expirationUnixTimestampSec?: BigNumber): Promise<SignedOrder> {
const defaultExpirationUnixTimestampSec = new BigNumber(2524604400); // Close to infinite
expirationUnixTimestampSec = _.isUndefined(expirationUnixTimestampSec) ?
defaultExpirationUnixTimestampSec :