Skip to content

Commit

Permalink
refactor: gov module handlers :error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Nov 17, 2022
1 parent bb0a0ac commit 97a7d50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mappings/gov/votes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import {CosmosEvent, CosmosMessage} from "@subql/types-cosmos";
import {GovProposalVoteMsg} from "../types";
import {messageId} from "../utils";
import {attemptHandling, messageId, unprocessedEventHandler} from "../utils";
import {GovProposalVote, GovProposalVoteOption} from "../../types";

export async function handleGovProposalVote(event: CosmosEvent): Promise<void> {
await attemptHandling(event, _handleGovProposalVote, unprocessedEventHandler);
}

async function _handleGovProposalVote(event: CosmosEvent): Promise<void> {
const msg: CosmosMessage<GovProposalVoteMsg> = event.msg;
logger.info(`[handleGovProposalVote] (tx ${msg.tx.hash}): indexing GovProposalVote ${messageId(msg)}`);
logger.debug(`[handleGovProposalVote] (event.msg.msg): ${JSON.stringify(msg.msg, null, 2)}`);
Expand Down

0 comments on commit 97a7d50

Please sign in to comment.