Skip to content

Commit e74f0b5

Browse files
authored
Fixed find event of msg grant (#49)
## Summary Fixed find event of msg grant ## Issue The find conditional to get the event of `MsgGrant` was wrong. ## Type of change Select one or more: - [ ] New feature, functionality or library - [x] Bug fix - [ ] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable
1 parent aadec20 commit e74f0b5

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)