github.com/PikeEcosystem/tendermint@v0.0.4/state/txindex/null/null.go (about) 1 package null 2 3 import ( 4 "context" 5 "errors" 6 7 abci "github.com/tendermint/tendermint/abci/types" 8 9 "github.com/PikeEcosystem/tendermint/libs/pubsub/query" 10 "github.com/PikeEcosystem/tendermint/state/txindex" 11 ) 12 13 var _ txindex.TxIndexer = (*TxIndex)(nil) 14 15 // TxIndex acts as a /dev/null. 16 type TxIndex struct{} 17 18 // Get on a TxIndex is disabled and panics when invoked. 19 func (txi *TxIndex) Get(hash []byte) (*abci.TxResult, error) { 20 return nil, errors.New(`indexing is disabled (set 'tx_index = "kv"' in config)`) 21 } 22 23 // AddBatch is a noop and always returns nil. 24 func (txi *TxIndex) AddBatch(batch *txindex.Batch) error { 25 return nil 26 } 27 28 // Index is a noop and always returns nil. 29 func (txi *TxIndex) Index(result *abci.TxResult) error { 30 return nil 31 } 32 33 func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) { 34 return []*abci.TxResult{}, nil 35 }