add tx conversions to get consensus tests to pass

This commit is contained in:
William Banfield
2022-03-08 17:26:56 -05:00
parent 7f617af927
commit 778e2e8908
3 changed files with 23 additions and 1 deletions
+10
View File
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/merkle"
"github.com/tendermint/tendermint/crypto/tmhash"
tmbytes "github.com/tendermint/tendermint/libs/bytes"
@@ -102,6 +103,15 @@ func ToTxs(txs [][]byte) Txs {
return txBzs
}
// TxRecordsToTxs coverts from the abci Tx type to the a Txs type.
func TxRecordsToTxs(trs []*abci.TxRecord) Txs {
txs := make([]Tx, len(trs))
for i, tr := range trs {
txs[i] = Tx(tr.Tx)
}
return txs
}
// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
type TxProof struct {
RootHash tmbytes.HexBytes `json:"root_hash"`