Some checks are pending
docker-build-cometbft / vars (push) Waiting to run
docker-build-cometbft / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-cometbft / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-cometbft / merge-images (push) Blocked by required conditions
docker-build-e2e-node / vars (push) Waiting to run
docker-build-e2e-node / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-e2e-node / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-e2e-node / merge-images (push) Blocked by required conditions
27 lines
828 B
Go
27 lines
828 B
Go
package indexer
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.cw.tr/mukan-network/mukan-consensus/libs/log"
|
|
"git.cw.tr/mukan-network/mukan-consensus/libs/pubsub/query"
|
|
"git.cw.tr/mukan-network/mukan-consensus/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)
|
|
|
|
SetLogger(l log.Logger)
|
|
}
|