You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
694 B

  1. package indexer
  2. import (
  3. "context"
  4. "github.com/tendermint/tendermint/libs/pubsub/query"
  5. "github.com/tendermint/tendermint/types"
  6. )
  7. // BlockIndexer defines an interface contract for indexing block events.
  8. type BlockIndexer interface {
  9. // Has returns true if the given height has been indexed. An error is returned
  10. // upon database query failure.
  11. Has(height int64) (bool, error)
  12. // Index indexes BeginBlock and EndBlock events for a given block by its height.
  13. Index(types.EventDataNewBlockHeader) error
  14. // Search performs a query for block heights that match a given BeginBlock
  15. // and Endblock event search criteria.
  16. Search(ctx context.Context, q *query.Query) ([]int64, error)
  17. }