add doc.go and fix lint

This commit is contained in:
William Banfield
2021-08-13 14:50:30 -04:00
parent 208bf0541b
commit 677d87324d
3 changed files with 8 additions and 1 deletions
+2
View File
@@ -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()
+2 -1
View File
@@ -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()
+4
View File
@@ -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