Use new proof method
This commit is contained in:
parent
18a1dd7f6b
commit
d629f27800
14
app/store.go
14
app/store.go
|
@ -180,12 +180,18 @@ func (s *Store) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)
|
||||||
key := reqQuery.Data // Data holds the key bytes
|
key := reqQuery.Data // Data holds the key bytes
|
||||||
resQuery.Key = key
|
resQuery.Key = key
|
||||||
if reqQuery.Prove {
|
if reqQuery.Prove {
|
||||||
value, proof, exists := tree.Proof(key)
|
value, proofExists, proofNotExists, err := tree.GetWithProof(key)
|
||||||
if !exists {
|
if err != nil {
|
||||||
resQuery.Log = "Key not found"
|
resQuery.Log = err.Error()
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if value != nil {
|
||||||
resQuery.Value = value
|
resQuery.Value = value
|
||||||
resQuery.Proof = proof
|
resQuery.Proof = wire.BinaryBytes(proofExists)
|
||||||
|
} else {
|
||||||
|
resQuery.Proof = wire.BinaryBytes(proofNotExists)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
value := tree.Get(key)
|
value := tree.Get(key)
|
||||||
resQuery.Value = value
|
resQuery.Value = value
|
||||||
|
|
Loading…
Reference in New Issue