Skip to content

Commit

Permalink
adding an event descriptor so we can subscribe to it.
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlavanet committed Oct 11, 2022
1 parent aeedaf9 commit 72c9d43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion utils/lavalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func LogLavaEvent(ctx sdk.Context, logger log.Logger, name string, attributes ma
attributes_str += fmt.Sprintf("%s: %s,", key, val)
eventAttrs = append(eventAttrs, sdk.NewAttribute(key, val))
}
logger.Info(fmt.Sprintf("%s%s: %s %s", EventPrefix, name, description, attributes_str))
logger.Info(fmt.Sprintf("%s%s:%s %s", EventPrefix, name, description, attributes_str))
ctx.EventManager().EmitEvent(sdk.NewEvent(EventPrefix+name, eventAttrs...))
}

Expand Down
4 changes: 2 additions & 2 deletions x/epochstorage/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {

am.keeper.StoreEpochStakeStorage(ctx, block, types.ClientKey)
// Notify world we have a new session
details := map[string]string{"height": fmt.Sprintf("%d", ctx.BlockHeight())}
details := map[string]string{"height": fmt.Sprintf("%d", ctx.BlockHeight()), "description": "New Block Epoch Started"}
logger := am.keeper.Logger(ctx)
utils.LogLavaEvent(ctx, logger, "new_epoch", details, "New Block Epoch Started")
utils.LogLavaEvent(ctx, logger, "new_epoch", details, "")
}
}

Expand Down

0 comments on commit 72c9d43

Please sign in to comment.