From 30045c3c05c832e72d400b86ea55b6807f1a4d35 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 22 Jun 2022 13:40:57 -0400 Subject: [PATCH] updates --- state/indexer/sink/pubsub/pubsub.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/state/indexer/sink/pubsub/pubsub.go b/state/indexer/sink/pubsub/pubsub.go index a3ce6f805..eab30af06 100644 --- a/state/indexer/sink/pubsub/pubsub.go +++ b/state/indexer/sink/pubsub/pubsub.go @@ -79,6 +79,11 @@ func NewEventSink(projectID, topic, chainID string) (*EventSink, error) { }, nil } +// IndexBlock attempts to index ResultBeginBlock and ResultEndBlock block events, +// where the data in each pubsub message includes the JSON encoding of the +// respective type. Additional attributes are included such as the block height, +// the chain ID and the message type. An error is returned if any encoding error +// is detected or if any message fails to publish. func (es *EventSink) IndexBlock(h types.EventDataNewBlockHeader) error { buf := new(bytes.Buffer) blockHeightStr := strconv.Itoa(int(h.Header.Height))