Make sure height in store increments every block, even if empty

This commit is contained in:
Ethan Frey
2017-10-10 15:03:39 +02:00
parent 9092b4d7f1
commit 5238448a46
3 changed files with 12 additions and 24 deletions
+2 -9
View File
@@ -1,8 +1,6 @@
package client
import (
"fmt"
"github.com/pkg/errors"
"github.com/tendermint/go-wire/data"
@@ -41,9 +39,9 @@ func GetWithProof(key []byte, node client.Client, cert certifiers.Certifier) (
return
}
// AppHash for height H is in header H+1
var check lc.Checkpoint
// check, err = GetCertifiedCheckpoint(int(resp.Height), node, cert)
check, err = GetCertifiedCheckpoint(int(resp.Height+9), node, cert)
check, err = GetCertifiedCheckpoint(int(resp.Height+1), node, cert)
if err != nil {
return
}
@@ -73,11 +71,6 @@ func GetWithProof(key []byte, node client.Client, cert certifiers.Certifier) (
err = errors.Wrap(err, "Error reading proof")
return
}
fmt.Printf("apphash: %x\n", check.Header.AppHash)
fmt.Printf("proof hash: %x\n", aproof.Root())
fmt.Printf("response height: %d\n", resp.Height)
// Validate the proof against the certified header to ensure data integrity.
err = aproof.Verify(resp.Key, nil, check.Header.AppHash)
if err != nil {