aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/test
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-24 05:21:45 +0800
committerFabio Berger <me@fabioberger.com>2017-11-24 05:21:45 +0800
commitb7b1721145f3894ade757a2ad4c366e2b6eadbe9 (patch)
tree0b724c1eb0c218a482a5b31b7438f67c33af61e3 /packages/0x.js/test
parent5068f1666a9d1dec2140f2a98e96bb880e854105 (diff)
downloaddexon-0x-contracts-b7b1721145f3894ade757a2ad4c366e2b6eadbe9.tar.gz
dexon-0x-contracts-b7b1721145f3894ade757a2ad4c366e2b6eadbe9.tar.zst
dexon-0x-contracts-b7b1721145f3894ade757a2ad4c366e2b6eadbe9.zip
Pass 'latest' to ExchangeTransferSimulator when used for validating orders, and pass 'pending' when used in the order watcher.
Diffstat (limited to 'packages/0x.js/test')
-rw-r--r--packages/0x.js/test/exchange_transfer_simulator_test.ts2
-rw-r--r--packages/0x.js/test/exchange_wrapper_test.ts2
-rw-r--r--packages/0x.js/test/order_validation_test.ts4
-rw-r--r--packages/0x.js/test/token_wrapper_test.ts2
4 files changed, 5 insertions, 5 deletions
diff --git a/packages/0x.js/test/exchange_transfer_simulator_test.ts b/packages/0x.js/test/exchange_transfer_simulator_test.ts
index 99cb7fb4f..ec2c045fc 100644
--- a/packages/0x.js/test/exchange_transfer_simulator_test.ts
+++ b/packages/0x.js/test/exchange_transfer_simulator_test.ts
@@ -37,7 +37,7 @@ describe('ExchangeTransferSimulator', () => {
});
describe('#transferFromAsync', () => {
beforeEach(() => {
- exchangeTransferSimulator = new ExchangeTransferSimulator(zeroEx.token);
+ exchangeTransferSimulator = new ExchangeTransferSimulator(zeroEx.token, BlockParamLiteral.Latest);
});
it('throws if the user doesn\'t have enough allowance', async () => {
return expect(exchangeTransferSimulator.transferFromAsync(
diff --git a/packages/0x.js/test/exchange_wrapper_test.ts b/packages/0x.js/test/exchange_wrapper_test.ts
index add89a3b2..b5fa47f8b 100644
--- a/packages/0x.js/test/exchange_wrapper_test.ts
+++ b/packages/0x.js/test/exchange_wrapper_test.ts
@@ -754,7 +754,7 @@ describe('ExchangeWrapper', () => {
const fillableAmount = new BigNumber(5);
const shouldThrowOnInsufficientBalanceOrAllowance = true;
const subscriptionOpts: SubscriptionOpts = {
- fromBlock: BlockParamLiteral.Earliest,
+ fromBlock: 0,
toBlock: BlockParamLiteral.Latest,
};
let txHash: string;
diff --git a/packages/0x.js/test/order_validation_test.ts b/packages/0x.js/test/order_validation_test.ts
index 4f18742d3..d689ef073 100644
--- a/packages/0x.js/test/order_validation_test.ts
+++ b/packages/0x.js/test/order_validation_test.ts
@@ -5,7 +5,7 @@ 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 {TradeSide, TransferType} from '../src/types';
+import {TradeSide, TransferType, BlockParamLiteral} from '../src/types';
import {TokenUtils} from './utils/token_utils';
import {BlockchainLifecycle} from './utils/blockchain_lifecycle';
import {FillScenarios} from './utils/fill_scenarios';
@@ -215,7 +215,7 @@ describe('OrderValidation', () => {
return Sinon.match((value: BigNumber) => value.eq(expected));
};
beforeEach('create exchangeTransferSimulator', async () => {
- exchangeTransferSimulator = new ExchangeTransferSimulator(zeroEx.token);
+ exchangeTransferSimulator = new ExchangeTransferSimulator(zeroEx.token, BlockParamLiteral.Latest);
transferFromAsync = Sinon.spy();
exchangeTransferSimulator.transferFromAsync = transferFromAsync as any;
});
diff --git a/packages/0x.js/test/token_wrapper_test.ts b/packages/0x.js/test/token_wrapper_test.ts
index 1a7cb9e40..27fe63590 100644
--- a/packages/0x.js/test/token_wrapper_test.ts
+++ b/packages/0x.js/test/token_wrapper_test.ts
@@ -426,7 +426,7 @@ describe('TokenWrapper', () => {
let tokenAddress: string;
let tokenTransferProxyAddress: string;
const subscriptionOpts: SubscriptionOpts = {
- fromBlock: BlockParamLiteral.Earliest,
+ fromBlock: 0,
toBlock: BlockParamLiteral.Latest,
};
let txHash: string;