mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-04 07:07:13 +00:00
add tx conversions to get consensus tests to pass
This commit is contained in:
+10
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user