sdk38: Use assert util in gov module test

This commit is contained in:
willclarktech 2020-07-16 11:07:59 +02:00
parent 79afed49af
commit c8ba1fd574
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7

View File

@ -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;