tendermint/state/txindex/null/null.go

22 lines
442 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{}
// Tx panics.
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
}
// Batch returns nil.
func (txi *TxIndex) AddBatch(batch *txindex.Batch) error {
return nil
}