tendermint/state/txindex/null/null.go

22 lines
509 B
Go
Raw Normal View History

2017-04-18 16:29:02 -07: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 00:59:05 -07:00
// Get on a TxIndex is disabled and panics when invoked.
2017-04-18 16:29:02 -07:00
func (txi *TxIndex) Get(hash []byte) (*types.TxResult, error) {
2017-04-18 17:55:40 -07:00
return nil, errors.New(`Indexing is disabled (set 'tx_index = "kv"' in config)`)
2017-04-18 16:29:02 -07:00
}
2017-10-17 00:59:05 -07:00
// AddBatch is a noop and always returns nil.
2017-04-18 16:29:02 -07:00
func (txi *TxIndex) AddBatch(batch *txindex.Batch) error {
return nil
}