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