github.com/vipernet-xyz/tm@v0.34.24/state/indexer/block/null/null.go (about)

     1  package null
     2  
     3  import (
     4  	"context"
     5  	"errors"
     6  
     7  	"github.com/vipernet-xyz/tm/libs/pubsub/query"
     8  	"github.com/vipernet-xyz/tm/state/indexer"
     9  	"github.com/vipernet-xyz/tm/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  }