From c8ba1fd574cf83894e5e65c33ba5c6e09184b62d Mon Sep 17 00:00:00 2001 From: willclarktech Date: Thu, 16 Jul 2020 11:07:59 +0200 Subject: [PATCH] sdk38: Use assert util in gov module test --- packages/sdk38/src/lcdapi/gov.spec.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/sdk38/src/lcdapi/gov.spec.ts b/packages/sdk38/src/lcdapi/gov.spec.ts index 88fd35f9..594be5d5 100644 --- a/packages/sdk38/src/lcdapi/gov.spec.ts +++ b/packages/sdk38/src/lcdapi/gov.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { sleep } from "@cosmjs/utils"; +import { assert, sleep } from "@cosmjs/utils"; import { coins } from "../coins"; import { isPostTxFailure } from "../cosmosclient"; @@ -67,9 +67,7 @@ describe("GovExtension", () => { }; const proposalReceipt = await client.postTx(proposalTx); - if (isPostTxFailure(proposalReceipt)) { - throw new Error("Proposal submission failed"); - } + assert(!isPostTxFailure(proposalReceipt)); proposalId = proposalReceipt.logs[0].events .find(({ type }) => type === "submit_proposal")! .attributes.find(({ key }) => key === "proposal_id")!.value;