update for sdk2 libs. need to fix kv test

NOTE we only updating for tmlibs and abci
This commit is contained in:
Ethan Buchman
2018-01-06 01:26:51 -05:00
parent 4e3488c677
commit cd0fd06b0d
23 changed files with 130 additions and 346 deletions

View File

@@ -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 {