This commit is contained in:
Aleksandr Bezobchuk
2022-06-15 15:43:24 -04:00
parent f1ff7df2ec
commit 418f5e08f8

View File

@@ -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)
}