From 09941b9aa9e4bc72fc2148a1340588234464776b Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 28 Nov 2017 21:38:16 -0600 Subject: [PATCH] fix metalinter warnings --- state/txindex/kv/kv.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/state/txindex/kv/kv.go b/state/txindex/kv/kv.go index d77711ed8..ae320cc1d 100644 --- a/state/txindex/kv/kv.go +++ b/state/txindex/kv/kv.go @@ -85,7 +85,10 @@ func (txi *TxIndex) AddBatch(b *txindex.Batch) error { // Index indexes a single transaction using the given list of tags. func (txi *TxIndex) Index(result *types.TxResult) error { batch := txindex.NewBatch(1) - batch.Add(result) + err := batch.Add(result) + if err != nil { + return errors.Wrap(err, "failed to add tx result to batch") + } return txi.AddBatch(batch) } @@ -342,10 +345,6 @@ func keyForTag(tag *abci.KVPair, result *types.TxResult) []byte { } } -func hashKey(hash []byte) string { - return fmt.Sprintf("%X", hash) -} - /////////////////////////////////////////////////////////////////////////////// // Utils