aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-10-26 04:04:31 +0800
committerGitHub <noreply@github.com>2017-10-26 04:04:31 +0800
commite78398862b5e7bb08d15590c9bd0c656994b2a1f (patch)
treed1a719dd67857d2555369d9b377518061798b597 /test
parentfa3e88c454e8d25fe8725dc7bf8ea35d6c3e33ab (diff)
parent122a5e9b63b5b3617ad63a56b0673fd9dd974208 (diff)
downloaddexon-sol-tools-e78398862b5e7bb08d15590c9bd0c656994b2a1f.tar
dexon-sol-tools-e78398862b5e7bb08d15590c9bd0c656994b2a1f.tar.gz
dexon-sol-tools-e78398862b5e7bb08d15590c9bd0c656994b2a1f.tar.bz2
dexon-sol-tools-e78398862b5e7bb08d15590c9bd0c656994b2a1f.tar.lz
dexon-sol-tools-e78398862b5e7bb08d15590c9bd0c656994b2a1f.tar.xz
dexon-sol-tools-e78398862b5e7bb08d15590c9bd0c656994b2a1f.tar.zst
dexon-sol-tools-e78398862b5e7bb08d15590c9bd0c656994b2a1f.zip
Merge pull request #202 from 0xProject/fix/bignumber-types
Bignumber types
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 :