@0x/contracts-exchange: Light refactoring in

`isolated_fill_order.ts` and `isolated_exchange_wrapper.ts`.
This commit is contained in:
Lawrence Forman
2019-08-08 11:43:55 -04:00
parent de897d2ebf
commit e3aa76cd09
2 changed files with 10 additions and 7 deletions

View File

@@ -46,14 +46,18 @@ blockchainTests('Isolated fillOrder() tests', env => {
before(async () => {
[takerAddress, notTakerAddress] = await env.getAccountAddressesAsync();
exchange = await IsolatedExchangeWrapper.deployAsync(
env.web3Wrapper,
_.assign(env.txDefaults, { from: takerAddress }),
);
exchange = await IsolatedExchangeWrapper.deployAsync(env.web3Wrapper, {
...env.txDefaults,
from: takerAddress,
});
});
function createOrder(details: Partial<Order> = {}): Order {
return _.assign({}, DEFAULT_ORDER, { salt: new BigNumber(nextSaltValue++) }, details);
return {
...DEFAULT_ORDER,
salt: new BigNumber(nextSaltValue++),
...details,
};
}
interface FillOrderAndAssertResultsResults {

View File

@@ -11,7 +11,6 @@ import { BigNumber } from '@0x/utils';
import { TxData, Web3Wrapper } from '@0x/web3-wrapper';
import * as crypto from 'crypto';
import { LogEntry } from 'ethereum-types';
import * as _ from 'lodash';
import {
artifacts,
@@ -105,7 +104,7 @@ export class IsolatedExchangeWrapper {
verifyingContractAddress: this.instance.address,
chainId: IsolatedExchangeWrapper.CHAIN_ID,
};
return orderHashUtils.getOrderHashHex(_.assign(order, { domain }));
return orderHashUtils.getOrderHashHex({ ...order, domain });
}
public async getOrderInfoAsync(order: Order): Promise<OrderInfo> {