diff --git a/state/indexer/sink/pubsub/wrapper.go b/state/indexer/sink/pubsub/wrapper.go index 0d0f66eaf..c24f9c87e 100644 --- a/state/indexer/sink/pubsub/wrapper.go +++ b/state/indexer/sink/pubsub/wrapper.go @@ -22,6 +22,10 @@ type BlockIndexer struct { sink *EventSink } +func NewBlockIndexer(sink *EventSink) *BlockIndexer { + return &BlockIndexer{sink: sink} +} + func (bi *BlockIndexer) Has(_ int64) (bool, error) { return false, errors.New("the Has method is not supported for the Pubsub indexer") } @@ -40,6 +44,10 @@ type TxIndexer struct { sink *EventSink } +func NewTxIndexer(sink *EventSink) *TxIndexer { + return &TxIndexer{sink: sink} +} + func (ti *TxIndexer) AddBatch(batch *txindex.Batch) error { return ti.sink.IndexTxs(batch.Ops) }