mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-06 13:26:23 +00:00
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:
@@ -83,7 +83,7 @@ func (c *Client) ABCIQueryWithOptions(path string, data tmbytes.HexBytes,
|
||||
if resp.IsErr() {
|
||||
return nil, fmt.Errorf("err response code: %v", resp.Code)
|
||||
}
|
||||
if len(resp.Key) == 0 || resp.Proof == nil {
|
||||
if len(resp.Key) == 0 || resp.ProofOps == nil {
|
||||
return nil, errors.New("empty tree")
|
||||
}
|
||||
if resp.Height <= 0 {
|
||||
@@ -108,7 +108,7 @@ func (c *Client) ABCIQueryWithOptions(path string, data tmbytes.HexBytes,
|
||||
kp := merkle.KeyPath{}
|
||||
kp = kp.AppendKey([]byte(storeName), merkle.KeyEncodingURL)
|
||||
kp = kp.AppendKey(resp.Key, merkle.KeyEncodingURL)
|
||||
err = c.prt.VerifyValue(resp.Proof, h.AppHash, kp.String(), resp.Value)
|
||||
err = c.prt.VerifyValue(resp.ProofOps, h.AppHash, kp.String(), resp.Value)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("verify value proof: %w", err)
|
||||
}
|
||||
@@ -117,7 +117,7 @@ func (c *Client) ABCIQueryWithOptions(path string, data tmbytes.HexBytes,
|
||||
|
||||
// OR validate the ansence proof against the trusted header.
|
||||
// XXX How do we encode the key into a string...
|
||||
err = c.prt.VerifyAbsence(resp.Proof, h.AppHash, string(resp.Key))
|
||||
err = c.prt.VerifyAbsence(resp.ProofOps, h.AppHash, string(resp.Key))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("verify absence proof: %w", err)
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
func defaultProofRuntime() *merkle.ProofRuntime {
|
||||
prt := merkle.NewProofRuntime()
|
||||
prt.RegisterOpDecoder(
|
||||
merkle.ProofOpSimpleValue,
|
||||
merkle.SimpleValueOpDecoder,
|
||||
merkle.ProofOpValue,
|
||||
merkle.ValueOpDecoder,
|
||||
)
|
||||
return prt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user