Update deps: tendermint/abci/iavl, fix code
This commit is contained in:
parent
de87acef0d
commit
422e67b382
|
@ -12,6 +12,7 @@ import (
|
||||||
"github.com/tendermint/go-wire/data"
|
"github.com/tendermint/go-wire/data"
|
||||||
"github.com/tendermint/iavl"
|
"github.com/tendermint/iavl"
|
||||||
"github.com/tendermint/light-client/proofs"
|
"github.com/tendermint/light-client/proofs"
|
||||||
|
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands"
|
"github.com/cosmos/cosmos-sdk/client/commands"
|
||||||
|
@ -47,7 +48,8 @@ func GetParsed(key []byte, data interface{}, prove bool) (uint64, error) {
|
||||||
func Get(key []byte, prove bool) (data.Bytes, uint64, error) {
|
func Get(key []byte, prove bool) (data.Bytes, uint64, error) {
|
||||||
if !prove {
|
if !prove {
|
||||||
node := commands.GetNode()
|
node := commands.GetNode()
|
||||||
resp, err := node.ABCIQuery("/key", key, false)
|
resp, err := node.ABCIQueryWithOptions("/key", key,
|
||||||
|
rpcclient.ABCIQueryOptions{Trusted: true})
|
||||||
return data.Bytes(resp.Value), resp.Height, err
|
return data.Bytes(resp.Value), resp.Height, err
|
||||||
}
|
}
|
||||||
val, h, _, err := GetWithProof(key)
|
val, h, _, err := GetWithProof(key)
|
||||||
|
|
|
@ -20,7 +20,7 @@ import (
|
||||||
func GetWithProof(key []byte, node client.Client, cert certifiers.Certifier) (
|
func GetWithProof(key []byte, node client.Client, cert certifiers.Certifier) (
|
||||||
val data.Bytes, height uint64, proof iavl.KeyProof, err error) {
|
val data.Bytes, height uint64, proof iavl.KeyProof, err error) {
|
||||||
|
|
||||||
resp, err := node.ABCIQuery("/key", key, true)
|
resp, err := node.ABCIQuery("/key", key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
hash: 738b6ed5402dee4f77a7063db84011a2ef776cda203a9c843a9830c9d0458a89
|
hash: fa04e2d0e8764d44c0f8e3400d7d12118b0f05aac6c12e5ff0d3dd1940c03100
|
||||||
updated: 2017-10-11T17:06:42.651532377-04:00
|
updated: 2017-10-18T13:44:50.561421607+02:00
|
||||||
imports:
|
imports:
|
||||||
- name: github.com/bgentry/speakeasy
|
- name: github.com/bgentry/speakeasy
|
||||||
version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd
|
version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd
|
||||||
|
@ -11,10 +11,6 @@ imports:
|
||||||
version: 637e656429416087660c84436a2a035d69d54e2e
|
version: 637e656429416087660c84436a2a035d69d54e2e
|
||||||
- name: github.com/BurntSushi/toml
|
- name: github.com/BurntSushi/toml
|
||||||
version: a368813c5e648fee92e5f6c30e3944ff9d5e8895
|
version: a368813c5e648fee92e5f6c30e3944ff9d5e8895
|
||||||
- name: github.com/davecgh/go-spew
|
|
||||||
version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9
|
|
||||||
subpackages:
|
|
||||||
- spew
|
|
||||||
- name: github.com/ebuchman/fail-test
|
- name: github.com/ebuchman/fail-test
|
||||||
version: 95f809107225be108efcf10a3509e4ea6ceef3c4
|
version: 95f809107225be108efcf10a3509e4ea6ceef3c4
|
||||||
- name: github.com/fsnotify/fsnotify
|
- name: github.com/fsnotify/fsnotify
|
||||||
|
@ -79,10 +75,6 @@ imports:
|
||||||
version: 13d49d4606eb801b8f01ae542b4afc4c6ee3d84a
|
version: 13d49d4606eb801b8f01ae542b4afc4c6ee3d84a
|
||||||
- name: github.com/pkg/errors
|
- name: github.com/pkg/errors
|
||||||
version: 645ef00459ed84a119197bfb8d8205042c6df63d
|
version: 645ef00459ed84a119197bfb8d8205042c6df63d
|
||||||
- name: github.com/pmezard/go-difflib
|
|
||||||
version: d8ed2627bdf02c080bf22230dbb337003b7aba2d
|
|
||||||
subpackages:
|
|
||||||
- difflib
|
|
||||||
- name: github.com/rcrowley/go-metrics
|
- name: github.com/rcrowley/go-metrics
|
||||||
version: 1f30fe9094a513ce4c700b9a54458bbb0c96996c
|
version: 1f30fe9094a513ce4c700b9a54458bbb0c96996c
|
||||||
- name: github.com/spf13/afero
|
- name: github.com/spf13/afero
|
||||||
|
@ -99,11 +91,6 @@ imports:
|
||||||
version: e57e3eeb33f795204c1ca35f56c44f83227c6e66
|
version: e57e3eeb33f795204c1ca35f56c44f83227c6e66
|
||||||
- name: github.com/spf13/viper
|
- name: github.com/spf13/viper
|
||||||
version: 0967fc9aceab2ce9da34061253ac10fb99bba5b2
|
version: 0967fc9aceab2ce9da34061253ac10fb99bba5b2
|
||||||
- name: github.com/stretchr/testify
|
|
||||||
version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0
|
|
||||||
subpackages:
|
|
||||||
- assert
|
|
||||||
- require
|
|
||||||
- name: github.com/syndtr/goleveldb
|
- name: github.com/syndtr/goleveldb
|
||||||
version: 8c81ea47d4c41a385645e133e15510fc6a2a74b4
|
version: 8c81ea47d4c41a385645e133e15510fc6a2a74b4
|
||||||
subpackages:
|
subpackages:
|
||||||
|
@ -120,7 +107,7 @@ imports:
|
||||||
- leveldb/table
|
- leveldb/table
|
||||||
- leveldb/util
|
- leveldb/util
|
||||||
- name: github.com/tendermint/abci
|
- name: github.com/tendermint/abci
|
||||||
version: 15cd7fb1e3b75c436b6dee89a44db35f3d265bd0
|
version: 3c16b313dd2342bb576844ade3acca3010928908
|
||||||
subpackages:
|
subpackages:
|
||||||
- client
|
- client
|
||||||
- example/dummy
|
- example/dummy
|
||||||
|
@ -132,8 +119,9 @@ imports:
|
||||||
- edwards25519
|
- edwards25519
|
||||||
- extra25519
|
- extra25519
|
||||||
- name: github.com/tendermint/go-crypto
|
- name: github.com/tendermint/go-crypto
|
||||||
version: 0418d32276d7d0f080e4c0e58b49c6ba2f717954
|
version: 8e7f0e7701f92206679ad093d013b9b162427631
|
||||||
subpackages:
|
subpackages:
|
||||||
|
- bcrypt
|
||||||
- keys
|
- keys
|
||||||
- keys/cryptostore
|
- keys/cryptostore
|
||||||
- keys/storage/filestorage
|
- keys/storage/filestorage
|
||||||
|
@ -145,20 +133,16 @@ imports:
|
||||||
- data
|
- data
|
||||||
- data/base58
|
- data/base58
|
||||||
- name: github.com/tendermint/iavl
|
- name: github.com/tendermint/iavl
|
||||||
version: 9233811d241ac8d4441a7223a4e79b83931dfae0
|
version: ff4ffa531df48509d51f0c16c2432f986eed9fcc
|
||||||
- name: github.com/tendermint/light-client
|
- name: github.com/tendermint/light-client
|
||||||
version: ac2e4bf47b31aaf5d3d336691ac786ec751bfc32
|
version: 79125bb4dfe173fe8a7208327ac4ec4c73d1a8a7
|
||||||
subpackages:
|
subpackages:
|
||||||
- certifiers
|
- certifiers
|
||||||
- certifiers/client
|
- certifiers/client
|
||||||
- certifiers/files
|
- certifiers/files
|
||||||
- proofs
|
- proofs
|
||||||
- name: github.com/tendermint/merkleeyes
|
|
||||||
version: 2f6e5d31e7a35045d8d0a5895cb1fec33dd4d32b
|
|
||||||
subpackages:
|
|
||||||
- iavl
|
|
||||||
- name: github.com/tendermint/tendermint
|
- name: github.com/tendermint/tendermint
|
||||||
version: d4634dc6832a7168c2536e7c71bfba4a8ca857be
|
version: b234f7aba2e6c39f0023be8712be23f7a78e1b11
|
||||||
subpackages:
|
subpackages:
|
||||||
- blockchain
|
- blockchain
|
||||||
- cmd/tendermint/commands
|
- cmd/tendermint/commands
|
||||||
|
@ -186,7 +170,7 @@ imports:
|
||||||
- types
|
- types
|
||||||
- version
|
- version
|
||||||
- name: github.com/tendermint/tmlibs
|
- name: github.com/tendermint/tmlibs
|
||||||
version: 7166252a521951eb8b6bd26db28b2b90586941a9
|
version: 8e5266a9ef2527e68a1571f932db8228a331b556
|
||||||
subpackages:
|
subpackages:
|
||||||
- autofile
|
- autofile
|
||||||
- cli
|
- cli
|
||||||
|
@ -199,10 +183,10 @@ imports:
|
||||||
- log
|
- log
|
||||||
- logger
|
- logger
|
||||||
- merkle
|
- merkle
|
||||||
- test
|
|
||||||
- name: golang.org/x/crypto
|
- name: golang.org/x/crypto
|
||||||
version: c7af5bf2638a1164f2eb5467c39c6cffbd13a02e
|
version: c7af5bf2638a1164f2eb5467c39c6cffbd13a02e
|
||||||
subpackages:
|
subpackages:
|
||||||
|
- blowfish
|
||||||
- curve25519
|
- curve25519
|
||||||
- nacl/box
|
- nacl/box
|
||||||
- nacl/secretbox
|
- nacl/secretbox
|
||||||
|
@ -253,7 +237,20 @@ imports:
|
||||||
- tap
|
- tap
|
||||||
- transport
|
- transport
|
||||||
- name: gopkg.in/go-playground/validator.v9
|
- name: gopkg.in/go-playground/validator.v9
|
||||||
version: 6d8c18553ea1ac493d049edd6f102f52e618f085
|
version: d529ee1b0f30352444f507cc6cdac96bfd12decc
|
||||||
- name: gopkg.in/yaml.v2
|
- name: gopkg.in/yaml.v2
|
||||||
version: cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b
|
version: cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b
|
||||||
testImports: []
|
testImports:
|
||||||
|
- name: github.com/davecgh/go-spew
|
||||||
|
version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9
|
||||||
|
subpackages:
|
||||||
|
- spew
|
||||||
|
- name: github.com/pmezard/go-difflib
|
||||||
|
version: d8ed2627bdf02c080bf22230dbb337003b7aba2d
|
||||||
|
subpackages:
|
||||||
|
- difflib
|
||||||
|
- name: github.com/stretchr/testify
|
||||||
|
version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0
|
||||||
|
subpackages:
|
||||||
|
- assert
|
||||||
|
- require
|
||||||
|
|
|
@ -7,7 +7,7 @@ import:
|
||||||
- package: github.com/spf13/pflag
|
- package: github.com/spf13/pflag
|
||||||
- package: github.com/spf13/viper
|
- package: github.com/spf13/viper
|
||||||
- package: github.com/tendermint/abci
|
- package: github.com/tendermint/abci
|
||||||
version: develop
|
version: feature/merkleeyes-to-iavl
|
||||||
subpackages:
|
subpackages:
|
||||||
- server
|
- server
|
||||||
- types
|
- types
|
||||||
|
@ -20,7 +20,7 @@ import:
|
||||||
subpackages:
|
subpackages:
|
||||||
- data
|
- data
|
||||||
- package: github.com/tendermint/light-client
|
- package: github.com/tendermint/light-client
|
||||||
version: develop
|
version: feature/merkleeyes-to-iavl
|
||||||
subpackages:
|
subpackages:
|
||||||
- proofs
|
- proofs
|
||||||
- certifiers
|
- certifiers
|
||||||
|
@ -29,7 +29,7 @@ import:
|
||||||
- package: github.com/tendermint/iavl
|
- package: github.com/tendermint/iavl
|
||||||
version: develop
|
version: develop
|
||||||
- package: github.com/tendermint/tendermint
|
- package: github.com/tendermint/tendermint
|
||||||
version: 0.11.1
|
version: develop
|
||||||
subpackages:
|
subpackages:
|
||||||
- config
|
- config
|
||||||
- node
|
- node
|
||||||
|
|
|
@ -18,7 +18,7 @@ import (
|
||||||
type MockChain struct {
|
type MockChain struct {
|
||||||
keys certifiers.ValKeys
|
keys certifiers.ValKeys
|
||||||
chainID string
|
chainID string
|
||||||
tree *iavl.IAVLTree
|
tree *iavl.Tree
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewMockChain initializes a teststore and test validators
|
// NewMockChain initializes a teststore and test validators
|
||||||
|
@ -26,7 +26,7 @@ func NewMockChain(chainID string, numKeys int) MockChain {
|
||||||
return MockChain{
|
return MockChain{
|
||||||
keys: certifiers.GenValKeys(numKeys),
|
keys: certifiers.GenValKeys(numKeys),
|
||||||
chainID: chainID,
|
chainID: chainID,
|
||||||
tree: iavl.NewIAVLTree(0, nil),
|
tree: iavl.NewTree(0, nil),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ func genEmptySeed(keys certifiers.ValKeys, chain string, h int,
|
||||||
return certifiers.Seed{cp, vals}
|
return certifiers.Seed{cp, vals}
|
||||||
}
|
}
|
||||||
|
|
||||||
func makePostPacket(tree *iavl.IAVLTree, packet Packet, fromID string, fromHeight int) PostPacketTx {
|
func makePostPacket(tree *iavl.Tree, packet Packet, fromID string, fromHeight int) PostPacketTx {
|
||||||
key := []byte(fmt.Sprintf("some-long-prefix-%06d", packet.Sequence))
|
key := []byte(fmt.Sprintf("some-long-prefix-%06d", packet.Sequence))
|
||||||
tree.Set(key, packet.Bytes())
|
tree.Set(key, packet.Bytes())
|
||||||
_, proof, err := tree.GetWithProof(key)
|
_, proof, err := tree.GetWithProof(key)
|
||||||
|
|
|
@ -31,7 +31,7 @@ func NewBonsai(tree *iavl.VersionedTree) *Bonsai {
|
||||||
|
|
||||||
// Get matches the signature of KVStore
|
// Get matches the signature of KVStore
|
||||||
func (b *Bonsai) Get(key []byte) []byte {
|
func (b *Bonsai) Get(key []byte) []byte {
|
||||||
_, value, _ := b.Tree.Get(key)
|
_, value := b.Tree.Get(key)
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue