You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
871 B

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