gitlab.com/gpdionisio/tendermint@v0.34.19-dev2/state/indexer/block/null/null.go (about)

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