Make sure height in store increments every block, even if empty
This commit is contained in:
+2
-9
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user