mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-20 23:12:44 +00:00
add doc.go and fix lint
This commit is contained in:
@@ -35,6 +35,8 @@ type Inspect struct {
|
||||
}
|
||||
|
||||
// New constructs a new Inspect from the passed in parameters.
|
||||
///
|
||||
//nolint:lll
|
||||
func New(rpcConfig *cfg.RPCConfig, blockStore sm.BlockStore, stateStore sm.Store, eventSinks []indexer.EventSink, logger log.Logger) *Inspect {
|
||||
routes := inspect_rpc.Routes(stateStore, blockStore, eventSinks)
|
||||
eventBus := types.NewEventBus()
|
||||
|
||||
@@ -113,7 +113,8 @@ func TestInspectTxSearch(t *testing.T) {
|
||||
eventSinkMock := &indexer_mocks.EventSink{}
|
||||
eventSinkMock.On("Stop").Return(nil)
|
||||
eventSinkMock.On("Type").Return(indexer.KV)
|
||||
eventSinkMock.On("SearchTxEvents", mock.Anything, mock.MatchedBy(func(q *query.Query) bool { return testQuery == q.String() })).
|
||||
eventSinkMock.On("SearchTxEvents", mock.Anything,
|
||||
mock.MatchedBy(func(q *query.Query) bool { return testQuery == q.String() })).
|
||||
Return([]*abci_types.TxResult{testTxResult}, nil)
|
||||
|
||||
rpcConfig := config.TestRPCConfig()
|
||||
|
||||
@@ -11,6 +11,10 @@ import (
|
||||
"github.com/tendermint/tendermint/state/indexer/sink/psql"
|
||||
)
|
||||
|
||||
// EventSinksFromConfig constructs a slice of indexer.EventSink using the provided
|
||||
// configuration.
|
||||
//
|
||||
//nolint:lll
|
||||
func EventSinksFromConfig(cfg *config.Config, dbProvider config.DBProvider, chainID string) ([]indexer.EventSink, error) {
|
||||
if len(cfg.TxIndex.Indexer) == 0 {
|
||||
return []indexer.EventSink{null.NewEventSink()}, nil
|
||||
|
||||
Reference in New Issue
Block a user