Use new Certifier type from light-client
This commit is contained in:
parent
1882376a34
commit
d1b49da825
|
@ -11,6 +11,7 @@ import (
|
||||||
wire "github.com/tendermint/go-wire"
|
wire "github.com/tendermint/go-wire"
|
||||||
"github.com/tendermint/go-wire/data"
|
"github.com/tendermint/go-wire/data"
|
||||||
lc "github.com/tendermint/light-client"
|
lc "github.com/tendermint/light-client"
|
||||||
|
"github.com/tendermint/light-client/certifiers"
|
||||||
"github.com/tendermint/light-client/proofs"
|
"github.com/tendermint/light-client/proofs"
|
||||||
"github.com/tendermint/merkleeyes/iavl"
|
"github.com/tendermint/merkleeyes/iavl"
|
||||||
"github.com/tendermint/tendermint/rpc/client"
|
"github.com/tendermint/tendermint/rpc/client"
|
||||||
|
@ -18,10 +19,6 @@ import (
|
||||||
"github.com/tendermint/basecoin/client/commands"
|
"github.com/tendermint/basecoin/client/commands"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Certifier interface {
|
|
||||||
Certify(check lc.Checkpoint) error
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetParsed does most of the work of the query commands, but is quite
|
// GetParsed does most of the work of the query commands, but is quite
|
||||||
// opinionated, so if you want more control about parsing, call Get
|
// opinionated, so if you want more control about parsing, call Get
|
||||||
// directly.
|
// directly.
|
||||||
|
@ -73,7 +70,7 @@ func GetWithProof(key []byte) (data.Bytes, uint64,
|
||||||
return getWithProof(key, node, cert)
|
return getWithProof(key, node, cert)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getWithProof(key []byte, node client.Client, cert Certifier) (data.Bytes, uint64,
|
func getWithProof(key []byte, node client.Client, cert certifiers.Certifier) (data.Bytes, uint64,
|
||||||
*iavl.KeyExistsProof, *iavl.KeyNotExistsProof, error) {
|
*iavl.KeyExistsProof, *iavl.KeyNotExistsProof, error) {
|
||||||
|
|
||||||
resp, err := node.ABCIQuery("/key", key, true)
|
resp, err := node.ABCIQuery("/key", key, true)
|
||||||
|
@ -133,7 +130,7 @@ func getWithProof(key []byte, node client.Client, cert Certifier) (data.Bytes, u
|
||||||
// GetCertifiedCheckpoint gets the signed header for a given height
|
// GetCertifiedCheckpoint gets the signed header for a given height
|
||||||
// and certifies it. Returns error if unable to get a proven header.
|
// and certifies it. Returns error if unable to get a proven header.
|
||||||
func GetCertifiedCheckpoint(h int, node client.Client,
|
func GetCertifiedCheckpoint(h int, node client.Client,
|
||||||
cert Certifier) (empty lc.Checkpoint, err error) {
|
cert certifiers.Certifier) (empty lc.Checkpoint, err error) {
|
||||||
// get the checkpoint for this height
|
// get the checkpoint for this height
|
||||||
|
|
||||||
// FIXME: cannot use cert.GetByHeight for now, as it also requires
|
// FIXME: cannot use cert.GetByHeight for now, as it also requires
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
hash: 2848c30b31fb205f846dd7dfca14ebed8a3249cbc5aaa759066b2bab3e4bbf42
|
hash: 2848c30b31fb205f846dd7dfca14ebed8a3249cbc5aaa759066b2bab3e4bbf42
|
||||||
updated: 2017-08-04T15:38:45.048261895+02:00
|
updated: 2017-08-08T18:32:19.025782383+02:00
|
||||||
imports:
|
imports:
|
||||||
- name: github.com/bgentry/speakeasy
|
- name: github.com/bgentry/speakeasy
|
||||||
version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd
|
version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd
|
||||||
|
@ -135,7 +135,7 @@ imports:
|
||||||
- data
|
- data
|
||||||
- data/base58
|
- data/base58
|
||||||
- name: github.com/tendermint/light-client
|
- name: github.com/tendermint/light-client
|
||||||
version: fcf4e411583135a1900157b8b0274c41e20ea3a1
|
version: b2afece9635d11e77dd404019b9cf3885d34f4e5
|
||||||
subpackages:
|
subpackages:
|
||||||
- certifiers
|
- certifiers
|
||||||
- certifiers/client
|
- certifiers/client
|
||||||
|
@ -166,6 +166,7 @@ imports:
|
||||||
- rpc/lib/client
|
- rpc/lib/client
|
||||||
- rpc/lib/server
|
- rpc/lib/server
|
||||||
- rpc/lib/types
|
- rpc/lib/types
|
||||||
|
- rpc/test
|
||||||
- state
|
- state
|
||||||
- state/txindex
|
- state/txindex
|
||||||
- state/txindex/kv
|
- state/txindex/kv
|
||||||
|
|
Loading…
Reference in New Issue