refactor transaction integration tests to use new framework

This commit is contained in:
Michael Zhu
2019-11-07 15:49:49 -08:00
parent 761d0a0f18
commit 251d30d47f
5 changed files with 831 additions and 1011 deletions

View File

@@ -142,6 +142,12 @@ export class Actor {
customTransactionParams: Partial<ZeroExTransaction>,
signatureType: SignatureType = SignatureType.EthSign,
): Promise<SignedZeroExTransaction> {
return this._transactionFactory.newSignedTransactionAsync(customTransactionParams, signatureType);
return this._transactionFactory.newSignedTransactionAsync(
{
gasPrice: DeploymentManager.gasPrice,
...customTransactionParams,
},
signatureType,
);
}
}

View File

@@ -1,4 +1,4 @@
import { constants, OrderFactory, orderUtils } from '@0x/contracts-test-utils';
import { constants, OrderFactory } from '@0x/contracts-test-utils';
import { Order, SignedOrder } from '@0x/types';
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
@@ -58,8 +58,7 @@ export function MakerMixin<TBase extends Constructor>(Base: TBase): TBase & Cons
* Cancels one of the maker's orders.
*/
public async cancelOrderAsync(order: SignedOrder): Promise<TransactionReceiptWithDecodedLogs> {
const params = orderUtils.createCancel(order);
return this.actor.deployment.exchange.cancelOrder(params.order).awaitTransactionSuccessAsync({
return this.actor.deployment.exchange.cancelOrder(order).awaitTransactionSuccessAsync({
from: this.actor.address,
});
}