appease static tests

This commit is contained in:
Michael Zhu 2019-10-04 10:02:50 -07:00
parent c17984b74f
commit cf517b1459
3 changed files with 17 additions and 20 deletions

View File

@ -18,7 +18,7 @@ import {
import { assetDataUtils, CoordinatorRevertErrors, transactionHashUtils } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
import { ApprovalFactory, artifacts, CoordinatorTestFactory, CoordinatorContract } from '../src';
import { ApprovalFactory, artifacts, CoordinatorContract, CoordinatorTestFactory } from '../src';
// tslint:disable:no-unnecessary-type-assertion
blockchainTests.resets('Coordinator tests', env => {

View File

@ -31,6 +31,17 @@ export class CoordinatorTestFactory {
});
}
private static _expectedCancelEvent(order: SignedOrder): ExchangeCancelEventArgs {
return {
makerAddress: order.makerAddress,
senderAddress: order.senderAddress,
feeRecipientAddress: order.feeRecipientAddress,
makerAssetData: order.makerAssetData,
takerAssetData: order.takerAssetData,
orderHash: orderHashUtils.getOrderHashHex(order),
};
}
constructor(
private readonly _coordinatorContract: CoordinatorContract,
private readonly _erc20Wrapper: ERC20Wrapper,
@ -65,7 +76,7 @@ export class CoordinatorTestFactory {
txData: Partial<TxData>,
revertError?: RevertError,
): Promise<void> {
const initBalances = await this._getTokenBalances();
const initBalances = await this._getTokenBalancesAsync();
const tx = this._coordinatorContract.executeTransaction.awaitTransactionSuccessAsync(
transaction,
txOrigin,
@ -124,8 +135,8 @@ export class CoordinatorTestFactory {
}
}
private async _getTokenBalances(): Promise<TokenBalances> {
let erc20Balances = await this._erc20Wrapper.getBalancesAsync();
private async _getTokenBalancesAsync(): Promise<TokenBalances> {
const erc20Balances = await this._erc20Wrapper.getBalancesAsync();
const ethBalances = _.zipObject(
this._addresses,
await Promise.all(this._addresses.map(address => web3Wrapper.getBalanceInWeiAsync(address))),
@ -208,7 +219,7 @@ export class CoordinatorTestFactory {
private async _verifyBalancesAsync(expectedBalances: TokenBalances): Promise<void> {
const { erc20: expectedErc20Balances, eth: expectedEthBalances } = expectedBalances;
const { erc20: actualErc20Balances, eth: actualEthBalances } = await this._getTokenBalances();
const { erc20: actualErc20Balances, eth: actualEthBalances } = await this._getTokenBalancesAsync();
const ownersByName = {
maker: this._makerAddress,
taker: this._takerAddress,
@ -254,15 +265,4 @@ export class CoordinatorTestFactory {
orderHash: orderHashUtils.getOrderHashHex(order),
};
}
private static _expectedCancelEvent(order: SignedOrder): ExchangeCancelEventArgs {
return {
makerAddress: order.makerAddress,
senderAddress: order.senderAddress,
feeRecipientAddress: order.feeRecipientAddress,
makerAssetData: order.makerAssetData,
takerAssetData: order.takerAssetData,
orderHash: orderHashUtils.getOrderHashHex(order),
};
}
}

View File

@ -24,10 +24,7 @@ export const constants = {
ExchangeFunctionName.MarketBuyOrdersNoThrow,
ExchangeFunctionName.MarketSellOrdersNoThrow,
],
MATCH_ORDER_FN_NAMES: [
ExchangeFunctionName.MatchOrders,
ExchangeFunctionName.MatchOrdersWithMaximalFill,
],
MATCH_ORDER_FN_NAMES: [ExchangeFunctionName.MatchOrders, ExchangeFunctionName.MatchOrdersWithMaximalFill],
BATCH_MATCH_ORDER_FN_NAMES: [
ExchangeFunctionName.BatchMatchOrders,
ExchangeFunctionName.BatchMatchOrdersWithMaximalFill,