mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 18:21:38 +00:00
fixes from rebase
This commit is contained in:
@ -105,7 +105,7 @@ func TestABCIQuery(t *testing.T) {
|
||||
k, v, tx := MakeTxKV()
|
||||
bres, err := c.BroadcastTxCommit(tx)
|
||||
require.Nil(t, err, "%d: %+v", i, err)
|
||||
apph := int(bres.Height) + 1 // this is where the tx will be applied to the state
|
||||
apph := bres.Height + 1 // this is where the tx will be applied to the state
|
||||
|
||||
// wait before querying
|
||||
client.WaitForHeight(c, apph, nil)
|
||||
@ -137,7 +137,7 @@ func TestAppCalls(t *testing.T) {
|
||||
bres, err := c.BroadcastTxCommit(tx)
|
||||
require.Nil(err, "%d: %+v", i, err)
|
||||
require.True(bres.DeliverTx.Code.IsOK())
|
||||
txh := int(bres.Height)
|
||||
txh := bres.Height
|
||||
apph := txh + 1 // this is where the tx will be applied to the state
|
||||
|
||||
// wait before querying
|
||||
|
@ -89,13 +89,13 @@ func Tx(hash []byte, prove bool) (*ctypes.ResultTx, error) {
|
||||
var proof types.TxProof
|
||||
if prove {
|
||||
// TODO: handle overflow
|
||||
block := blockStore.LoadBlock(int(height))
|
||||
proof = block.Data.Txs.Proof(int(index))
|
||||
block := blockStore.LoadBlock(height)
|
||||
proof = block.Data.Txs.Proof(index)
|
||||
}
|
||||
|
||||
return &ctypes.ResultTx{
|
||||
Height: height,
|
||||
Index: index,
|
||||
Index: uint32(index),
|
||||
TxResult: r.Result,
|
||||
Tx: r.Tx,
|
||||
Proof: proof,
|
||||
@ -188,7 +188,7 @@ func TxSearch(query string, prove bool) ([]*ctypes.ResultTx, error) {
|
||||
|
||||
if prove {
|
||||
// TODO: handle overflow
|
||||
block := blockStore.LoadBlock(int(height))
|
||||
block := blockStore.LoadBlock(height)
|
||||
proof = block.Data.Txs.Proof(int(index))
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ import (
|
||||
abci "github.com/tendermint/abci/types"
|
||||
crypto "github.com/tendermint/go-crypto"
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
"github.com/tendermint/tendermint/state/txindex"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
@ -271,26 +270,6 @@ func (s *State) CommitStateUpdateMempool(proxyAppConn proxy.AppConnConsensus, bl
|
||||
return mempool.Update(block.Height, block.Txs)
|
||||
}
|
||||
|
||||
func (s *State) indexTxs(abciResponses *ABCIResponses) {
|
||||
// save the tx results using the TxIndexer
|
||||
// NOTE: these may be overwriting, but the values should be the same.
|
||||
batch := txindex.NewBatch(len(abciResponses.DeliverTx))
|
||||
for i, d := range abciResponses.DeliverTx {
|
||||
tx := abciResponses.txs[i]
|
||||
if err := batch.Add(types.TxResult{
|
||||
Height: abciResponses.Height,
|
||||
Index: uint32(i),
|
||||
Tx: tx,
|
||||
Result: *d,
|
||||
}); err != nil {
|
||||
s.logger.Error("Error with batch.Add", "err", err)
|
||||
}
|
||||
}
|
||||
if err := s.TxIndexer.AddBatch(batch); err != nil {
|
||||
s.logger.Error("Error adding batch", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
// ExecCommitBlock executes and commits a block on the proxyApp without validating or mutating the state.
|
||||
// It returns the application root hash (result of abci.Commit).
|
||||
func ExecCommitBlock(appConnConsensus proxy.AppConnConsensus, block *types.Block, logger log.Logger) ([]byte, error) {
|
||||
|
Reference in New Issue
Block a user