mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-06 13:26:23 +00:00
update for sdk2 libs. need to fix kv test
NOTE we only updating for tmlibs and abci
This commit is contained in:
@@ -86,11 +86,16 @@ func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOption
|
||||
// https://github.com/tendermint/tendermint/issues/1183
|
||||
if len(resp.Value) > 0 {
|
||||
// The key was found, construct a proof of existence.
|
||||
eproof, err := iavl.ReadKeyExistsProof(resp.Proof)
|
||||
proof, err := iavl.ReadKeyProof(resp.Proof)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "Error reading proof")
|
||||
}
|
||||
|
||||
eproof, ok := proof.(*iavl.KeyExistsProof)
|
||||
if !ok {
|
||||
return nil, nil, errors.New("Expected KeyExistsProof for non-empty value")
|
||||
}
|
||||
|
||||
// Validate the proof against the certified header to ensure data integrity.
|
||||
err = eproof.Verify(resp.Key, resp.Value, commit.Header.AppHash)
|
||||
if err != nil {
|
||||
@@ -100,11 +105,16 @@ func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOption
|
||||
}
|
||||
|
||||
// The key wasn't found, construct a proof of non-existence.
|
||||
var aproof *iavl.KeyAbsentProof
|
||||
aproof, err = iavl.ReadKeyAbsentProof(resp.Proof)
|
||||
proof, err := iavl.ReadKeyProof(resp.Proof)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "Error reading proof")
|
||||
}
|
||||
|
||||
aproof, ok := proof.(*iavl.KeyAbsentProof)
|
||||
if !ok {
|
||||
return nil, nil, errors.New("Expected KeyAbsentProof for empty Value")
|
||||
}
|
||||
|
||||
// Validate the proof against the certified header to ensure data integrity.
|
||||
err = aproof.Verify(resp.Key, nil, commit.Header.AppHash)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user