Rebase and address review comments.

This commit is contained in:
Lawrence Forman
2020-02-07 22:29:32 -05:00
parent 3e8f9a6b53
commit ae650849b0
5 changed files with 135 additions and 276 deletions

View File

@@ -119,7 +119,7 @@ blockchainTests.resets('Coordinator integration tests', env => {
order = await maker.signOrderAsync();
data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, [order]);
transaction = await taker.signTransactionAsync({ data });
approval = await feeRecipient.signCoordinatorApprovalAsync(transaction, taker.address);
approval = feeRecipient.signCoordinatorApproval(transaction, taker.address);
});
it(`${fnName} should fill the order with a signed approval`, async () => {
@@ -253,7 +253,7 @@ blockchainTests.resets('Coordinator integration tests', env => {
orders = [await maker.signOrderAsync(), await maker.signOrderAsync()];
data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
transaction = await taker.signTransactionAsync({ data });
approval = await feeRecipient.signCoordinatorApprovalAsync(transaction, taker.address);
approval = feeRecipient.signCoordinatorApproval(transaction, taker.address);
});
it(`${fnName} should fill the orders with a signed approval`, async () => {

View File

@@ -10,11 +10,11 @@ interface FeeRecipientConfig extends ActorConfig {
export interface FeeRecipientInterface {
approvalFactory?: ApprovalFactory;
signCoordinatorApprovalAsync: (
signCoordinatorApproval: (
transaction: SignedZeroExTransaction,
txOrigin: string,
signatureType?: SignatureType,
) => Promise<SignedCoordinatorApproval>;
) => SignedCoordinatorApproval;
}
/**
@@ -46,11 +46,11 @@ export function FeeRecipientMixin<TBase extends Constructor>(Base: TBase): TBase
/**
* Signs an coordinator transaction.
*/
public async signCoordinatorApprovalAsync(
public signCoordinatorApproval(
transaction: SignedZeroExTransaction,
txOrigin: string,
signatureType: SignatureType = SignatureType.EthSign,
): Promise<SignedCoordinatorApproval> {
): SignedCoordinatorApproval {
if (this.approvalFactory === undefined) {
throw new Error('No verifying contract provided in FeeRecipient constructor');
}

View File

@@ -200,7 +200,7 @@ tests('Exchange signature validation fuzz tests', env => {
exchangeAddress: mangled.order!.exchangeAddress,
chainId: mangled.order!.chainId,
});
mangled.hash = await orderHashUtils.getOrderHashHex(mangled.order);
mangled.hash = orderHashUtils.getOrderHashHex(mangled.order);
break;
case 'RANDOM_TRANSACTION':
mangled.transaction = randomTransaction({
@@ -398,7 +398,7 @@ tests('Exchange signature validation fuzz tests', env => {
fields.validator || (signatureType === SignatureType.Validator ? walletContractAddress : undefined);
const signerKey = fields.signerKey || privateKeys[signer];
const order = fields.order || randomOrder({ makerAddress: signer });
const hash = fields.hash || (await orderHashUtils.getOrderHashHex(order));
const hash = fields.hash || orderHashUtils.getOrderHashHex(order);
const payload =
fields.payload ||
(STRICT_LENGTH_SIGNATURE_TYPES.includes(signatureType) ? constants.NULL_BYTES : randomPayload());