From d80701c2779512324c7a9bef2a87b6f63239d281 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Wed, 29 Aug 2018 15:35:09 -0700 Subject: Fix geth tests --- packages/contracts/test/utils/assertions.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'packages/contracts/test/utils/assertions.ts') diff --git a/packages/contracts/test/utils/assertions.ts b/packages/contracts/test/utils/assertions.ts index 61df800c8..3361a751a 100644 --- a/packages/contracts/test/utils/assertions.ts +++ b/packages/contracts/test/utils/assertions.ts @@ -159,7 +159,7 @@ export async function expectTransactionFailedWithoutReasonAsync(p: sendTransacti * @returns a new Promise which will reject if the conditions are not met and * otherwise resolve with no value. */ -export async function expectContractCallFailed(p: Promise, reason: RevertReason): Promise { +export async function expectContractCallFailedAsync(p: Promise, reason: RevertReason): Promise { return expect(p).to.be.rejectedWith(reason); } @@ -180,7 +180,20 @@ export async function expectContractCallFailedWithoutReasonAsync(p: Promise(p: Promise): Promise { +export async function expectContractCreationFailedAsync( + p: sendTransactionResult, + reason: RevertReason, +): Promise { + return expectTransactionFailedAsync(p, reason); +} + +/** + * Resolves if the contract creation/deployment fails without a revert reason. + * @param p a Promise resulting from a contract creation/deployment + * @returns a new Promise which will reject if the conditions are not met and + * otherwise resolve with no value. + */ +export async function expectContractCreationFailedWithoutReasonAsync(p: Promise): Promise { const errMessage = await _getTransactionFailedErrorMessageAsync(); return expect(p).to.be.rejectedWith(errMessage); } -- cgit v1.2.3