github.com/aakash4dev/cometbft@v0.38.2/state/indexer/block/null/null.go (about)

     1  package null
     2  
     3  import (
     4  	"context"
     5  	"errors"
     6  
     7  	"github.com/aakash4dev/cometbft/libs/log"
     8  	"github.com/aakash4dev/cometbft/libs/pubsub/query"
     9  	"github.com/aakash4dev/cometbft/state/indexer"
    10  	"github.com/aakash4dev/cometbft/types"
    11  )
    12  
    13  var _ indexer.BlockIndexer = (*BlockerIndexer)(nil)
    14  
    15  // TxIndex implements a no-op block indexer.
    16  type BlockerIndexer struct{}
    17  
    18  func (idx *BlockerIndexer) Has(int64) (bool, error) {
    19  	return false, errors.New(`indexing is disabled (set 'tx_index = "kv"' in config)`)
    20  }
    21  
    22  func (idx *BlockerIndexer) Index(types.EventDataNewBlockEvents) error {
    23  	return nil
    24  }
    25  
    26  func (idx *BlockerIndexer) Search(context.Context, *query.Query) ([]int64, error) {
    27  	return []int64{}, nil
    28  }
    29  
    30  func (idx *BlockerIndexer) SetLogger(log.Logger) {
    31  }