22 lines
509 B
Go
Raw Normal View History

2017-04-18 19:29:02 -04:00
package null
import (
"errors"
"github.com/tendermint/tendermint/state/txindex"
"github.com/tendermint/tendermint/types"
)
// TxIndex acts as a /dev/null.
type TxIndex struct{}
2017-10-17 09:59:05 +02:00
// Get on a TxIndex is disabled and panics when invoked.
2017-04-18 19:29:02 -04:00
func (txi *TxIndex) Get(hash []byte) (*types.TxResult, error) {
2017-04-18 20:55:40 -04:00
return nil, errors.New(`Indexing is disabled (set 'tx_index = "kv"' in config)`)
2017-04-18 19:29:02 -04:00
}
2017-10-17 09:59:05 +02:00
// AddBatch is a noop and always returns nil.
2017-04-18 19:29:02 -04:00
func (txi *TxIndex) AddBatch(batch *txindex.Batch) error {
return nil
}