crypto/merkle: remove simple prefix (#4989)

## Description

This PR removes simple prefix from all types in the crypto/merkle directory.

The two proto types `Proof` & `ProofOp` have been moved to the `proto/crypto/merkle` directory.

proto messge `Proof` was renamed to `ProofOps` and `SimpleProof` message to `Proof`. 

Closes: #2755
This commit is contained in:
Marko
2020-06-10 16:57:38 +02:00
committed by GitHub
parent d54de61bf6
commit 46f6d17601
34 changed files with 1318 additions and 1559 deletions

View File

@@ -37,7 +37,7 @@ func (txs Txs) Hash() []byte {
for i := 0; i < len(txs); i++ {
txBzs[i] = txs[i].Hash()
}
return merkle.SimpleHashFromByteSlices(txBzs)
return merkle.HashFromByteSlices(txBzs)
}
// Index returns the index of this transaction in the list, or -1 if not found
@@ -69,7 +69,7 @@ func (txs Txs) Proof(i int) TxProof {
for i := 0; i < l; i++ {
bzs[i] = txs[i].Hash()
}
root, proofs := merkle.SimpleProofsFromByteSlices(bzs)
root, proofs := merkle.ProofsFromByteSlices(bzs)
return TxProof{
RootHash: root,
@@ -80,9 +80,9 @@ func (txs Txs) Proof(i int) TxProof {
// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
type TxProof struct {
RootHash tmbytes.HexBytes `json:"root_hash"`
Data Tx `json:"data"`
Proof merkle.SimpleProof `json:"proof"`
RootHash tmbytes.HexBytes `json:"root_hash"`
Data Tx `json:"data"`
Proof merkle.Proof `json:"proof"`
}
// Leaf returns the hash(tx), which is the leaf in the merkle tree which this proof refers to.