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.

33 lines
830 B

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