github.com/badrootd/celestia-core@v0.0.0-20240305091328-aa4207a4b25d/state/indexer/block/null/null.go (about)

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