mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 04:55:18 +00:00
Adds the `FinalizeBlock` method which replaces `BeginBlock`, `DeliverTx`, and `EndBlock` in a single call.
25 lines
736 B
Go
25 lines
736 B
Go
package indexer
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/tendermint/tendermint/libs/pubsub/query"
|
|
"github.com/tendermint/tendermint/types"
|
|
)
|
|
|
|
//go:generate ../../scripts/mockery_generate.sh BlockIndexer
|
|
|
|
// BlockIndexer defines an interface contract for indexing block events.
|
|
type BlockIndexer interface {
|
|
// Has returns true if the given height has been indexed. An error is returned
|
|
// upon database query failure.
|
|
Has(height int64) (bool, error)
|
|
|
|
// Index indexes FinalizeBlock events for a given block by its height.
|
|
Index(types.EventDataNewBlockEvents) error
|
|
|
|
// Search performs a query for block heights that match a given FinalizeBlock
|
|
// event search criteria.
|
|
Search(ctx context.Context, q *query.Query) ([]int64, error)
|
|
}
|