Remove domain from Order type

This commit is contained in:
fragosti
2019-09-25 17:15:16 -07:00
parent 23b724dde4
commit 9870f55d24
36 changed files with 184 additions and 217 deletions

View File

@@ -101,11 +101,11 @@ export class IsolatedExchangeWrapper {
}
public getOrderHash(order: Order): string {
const domain = {
verifyingContract: this.instance.address,
const domainInfo = {
exchangeAddress: this.instance.address,
chainId: IsolatedExchangeWrapper.CHAIN_ID,
};
return orderHashUtils.getOrderHashHex({ ...order, domain });
return orderHashUtils.getOrderHashHex({ ...order, ...domainInfo });
}
public async getOrderInfoAsync(order: Order): Promise<OrderInfo> {
@@ -126,11 +126,11 @@ export class IsolatedExchangeWrapper {
TCallAsyncArgs extends any[],
TAwaitTransactionSuccessAsyncArgs extends any[],
TResult
>(
contractFunction: MutatorContractFunction<TCallAsyncArgs, TAwaitTransactionSuccessAsyncArgs, TResult>,
// tslint:disable-next-line: trailing-comma
...args: TAwaitTransactionSuccessAsyncArgs
): Promise<TResult> {
>(
contractFunction: MutatorContractFunction<TCallAsyncArgs, TAwaitTransactionSuccessAsyncArgs, TResult>,
// tslint:disable-next-line: trailing-comma
...args: TAwaitTransactionSuccessAsyncArgs
): Promise<TResult> {
this.lastTxEvents = createEmptyEvents();
this.lastTxBalanceChanges = {};
const [result, receipt] = await this.txHelper.getResultAndReceiptAsync(contractFunction, ...args);

View File

@@ -430,10 +430,8 @@ export class OrderFactoryFromScenario {
salt: generatePseudoRandomSalt(),
feeRecipientAddress,
expirationTimeSeconds,
domain: {
verifyingContract: this._exchangeAddress,
chainId: this._chainId,
},
exchangeAddress: this._exchangeAddress,
chainId: this._chainId,
};
return order;