diff --git a/README.md b/README.md
index 3a9b27cb..23c1ac65 100644
--- a/README.md
+++ b/README.md
@@ -100,7 +100,8 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil
* `Data ([]byte)`: The query response bytes
* `Log (string)`: Debug or error message
* __Usage__:
- Return a Merkle proof from the key/value pair back to the application hash.
+ Return a Merkle proof from the key/value pair back to the application hash.
+ *Please note* The current implementation of go-merkle doesn't support querying proofs from past blocks, so for the present moment, any height other than 0 will return an error. Hopefully this will be improved soon(ish)
#### Flush
* __Usage__:
diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go
index fcf067dc..39f54fc2 100644
--- a/example/dummy/dummy.go
+++ b/example/dummy/dummy.go
@@ -2,7 +2,6 @@ package dummy
import (
"encoding/hex"
- "fmt"
"strings"
"github.com/tendermint/abci/types"
@@ -50,18 +49,21 @@ func (app *DummyApplication) Commit() types.Result {
func (app *DummyApplication) Query(query []byte) types.Result {
index, value, exists := app.state.Get(query)
+
queryResult := QueryResult{index, string(value), hex.EncodeToString(value), exists}
return types.NewResultOK(wire.JSONBytes(queryResult), "")
}
func (app *DummyApplication) Proof(key []byte, blockHeight int64) types.Result {
+ // TODO: when go-merkle supports querying older blocks without possible panics,
+ // we should store a cache and allow a query. But for now it is impossible.
+ // And this is just a Dummy application anyway, what do you expect? ;)
if blockHeight != 0 {
return types.ErrUnknownRequest
}
proof, exists := app.state.Proof(key)
if !exists {
- fmt.Println("Didn't find nothing")
- return types.NewResultOK(nil, "")
+ return types.NewResultOK(nil, Fmt("Cannot find key = %v", key))
}
return types.NewResultOK(proof, "Found the key")
}