aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/utils/assertions.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-30 07:39:25 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-30 07:39:25 +0800
commit1312e4caf2b3f25de7cc3dc82c76df8b9467c923 (patch)
tree66e7e4ede9060ad9b8eb5d4ccf97ce7c59919c0f /packages/contracts/test/utils/assertions.ts
parentb1c5f6e8f175aab891b735ed0b4382a787cbbd9b (diff)
parenteb4517d7379128b18c830b704742154c8b2f3c8d (diff)
downloaddexon-sol-tools-1312e4caf2b3f25de7cc3dc82c76df8b9467c923.tar
dexon-sol-tools-1312e4caf2b3f25de7cc3dc82c76df8b9467c923.tar.gz
dexon-sol-tools-1312e4caf2b3f25de7cc3dc82c76df8b9467c923.tar.bz2
dexon-sol-tools-1312e4caf2b3f25de7cc3dc82c76df8b9467c923.tar.lz
dexon-sol-tools-1312e4caf2b3f25de7cc3dc82c76df8b9467c923.tar.xz
dexon-sol-tools-1312e4caf2b3f25de7cc3dc82c76df8b9467c923.tar.zst
dexon-sol-tools-1312e4caf2b3f25de7cc3dc82c76df8b9467c923.zip
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/website/v2-tweaks
Diffstat (limited to 'packages/contracts/test/utils/assertions.ts')
-rw-r--r--packages/contracts/test/utils/assertions.ts17
1 files changed, 15 insertions, 2 deletions
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<T>(p: Promise<T>, reason: RevertReason): Promise<void> {
+export async function expectContractCallFailedAsync<T>(p: Promise<T>, reason: RevertReason): Promise<void> {
return expect(p).to.be.rejectedWith(reason);
}
@@ -180,7 +180,20 @@ export async function expectContractCallFailedWithoutReasonAsync<T>(p: Promise<T
* @returns a new Promise which will reject if the conditions are not met and
* otherwise resolve with no value.
*/
-export async function expectContractCreationFailedWithoutReason<T>(p: Promise<T>): Promise<void> {
+export async function expectContractCreationFailedAsync<T>(
+ p: sendTransactionResult,
+ reason: RevertReason,
+): Promise<void> {
+ 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<T>(p: Promise<T>): Promise<void> {
const errMessage = await _getTransactionFailedErrorMessageAsync();
return expect(p).to.be.rejectedWith(errMessage);
}