Skip to content

Commit d395595

Browse files
committed
Fixed find event of msg grant
1 parent aadec20 commit d395595

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mappings/authz/grants.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ function _handleMsgGrant(msg: CosmosMessage<MsgGrant>): AuthzProps {
5454
const {grant, grantee, granter} = msg.msg.decodedMsg;
5555

5656
const expiration = grant.expiration ? new Date(Number(grant.expiration.seconds) * 1000 + Math.floor(grant.expiration.nanos / 1_000_000)) : undefined
57-
const event = msg.block.events.find(e => e.event.type === '' && isEventOfMessageKind(e) && e.tx.hash === msg.tx.hash)!
57+
const event = msg.block.events.find(e => e.event.type === 'cosmos.authz.v1beta1.EventGrant' && isEventOfMessageKind(e) && e.tx.hash === msg.tx.hash)!
58+
59+
if (!event) {
60+
throw new Error(`[handleMsgGrant] event for MsgGrant not found at ${msg.block.header.height} height`);
61+
}
5862

5963
let msgType: string | null = null
6064

0 commit comments

Comments
 (0)