From 655c00e5babd07438a2dde35ffe5756a7a71d285 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Fri, 17 Jun 2022 15:59:26 -0400 Subject: [PATCH] updates --- state/indexer/sink/pubsub/pubsub.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/state/indexer/sink/pubsub/pubsub.go b/state/indexer/sink/pubsub/pubsub.go index e16697d8e..2626d0abd 100644 --- a/state/indexer/sink/pubsub/pubsub.go +++ b/state/indexer/sink/pubsub/pubsub.go @@ -80,6 +80,7 @@ func NewEventSink(projectID, topic, chainID string) (*EventSink, error) { func (es *EventSink) IndexBlock(h types.EventDataNewBlockHeader) error { buf := new(bytes.Buffer) + blockHeightStr := strconv.Itoa(int(h.Header.Height)) // publish BeginBlock Events if err := jsonpbMarshaller.Marshal(buf, &h.ResultBeginBlock); err != nil { @@ -93,7 +94,7 @@ func (es *EventSink) IndexBlock(h types.EventDataNewBlockHeader) error { Attributes: map[string]string{ MsgType: MsgTypeBeginBlock, AttrKeyChainID: es.chainID, - AttrKeyBlockHeight: strconv.Itoa(int(h.Header.Height)), + AttrKeyBlockHeight: blockHeightStr, }, }, ) @@ -117,7 +118,7 @@ func (es *EventSink) IndexBlock(h types.EventDataNewBlockHeader) error { Attributes: map[string]string{ MsgType: MsgTypeEndBlock, AttrKeyChainID: es.chainID, - AttrKeyBlockHeight: strconv.Itoa(int(h.Header.Height)), + AttrKeyBlockHeight: blockHeightStr, }, }, )