types: add kv type (#6897)

* add kv type

* add changelog entry

* fix build

* replace sdkkv with kv

* revert change

* fix some tests

* proto-gen

* fix tests

Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Marko 2020-07-30 16:53:02 +02:00 committed by GitHub
parent c7ad21d162
commit 617b822efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 1317 additions and 925 deletions

View File

@ -305,6 +305,7 @@ pagination.
* (baseapp) [\#6053](https://github.com/cosmos/cosmos-sdk/pull/6053) Customizable panic recovery handling added for `app.runTx()` method (as proposed in the [ADR 22](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-022-custom-panic-handling.md)). Adds ability for developers to register custom panic handlers extending standard ones.
* (store) [\#6481](https://github.com/cosmos/cosmos-sdk/pull/6481) Move `SimpleProofsFromMap` from Tendermint into the SDK.
* (store) [\#6719](https://github.com/cosmos/cosmos-sdk/6754) Add validity checks to stores for nil and empty keys.
* (types) \#6897 Add KV type from tendermint to `types` directory.
## [v0.39.0] - 2020-07-20

View File

@ -29,7 +29,7 @@ func TestRejectUnknownFieldsRepeated(t *testing.T) {
F: &testdata.TestVersion2{
A: &testdata.TestVersion2{
B: &testdata.TestVersion2{
H: []*testdata.TestVersion2{
H: []*testdata.TestVersion1{
{
X: 0x01,
},
@ -44,7 +44,7 @@ func TestRejectUnknownFieldsRepeated(t *testing.T) {
F: &testdata.TestVersion2{
A: &testdata.TestVersion2{
B: &testdata.TestVersion2{
H: []*testdata.TestVersion2{
H: []*testdata.TestVersion1{
{
X: 0x02,
},
@ -84,7 +84,7 @@ func TestRejectUnknownFieldsRepeated(t *testing.T) {
F: &testdata.TestVersion2{
A: &testdata.TestVersion2{
B: &testdata.TestVersion2{
H: []*testdata.TestVersion2{
H: []*testdata.TestVersion1{
{
X: 0x01,
},
@ -99,7 +99,7 @@ func TestRejectUnknownFieldsRepeated(t *testing.T) {
F: &testdata.TestVersion2{
A: &testdata.TestVersion2{
B: &testdata.TestVersion2{
H: []*testdata.TestVersion2{
H: []*testdata.TestVersion1{
{
X: 0x02,
},
@ -309,13 +309,13 @@ func TestRejectUnknownFieldsNested(t *testing.T) {
Sum: &testdata.TestVersion2_E{
E: 100,
},
H: []*testdata.TestVersion2{
H: []*testdata.TestVersion1{
{X: 999},
{X: -55},
{
X: 102,
Sum: &testdata.TestVersion2_F{
F: &testdata.TestVersion2{
Sum: &testdata.TestVersion1_F{
F: &testdata.TestVersion1{
X: 4,
},
},

10
proto/cosmos/kv/kv.proto Normal file
View File

@ -0,0 +1,10 @@
syntax = "proto3";
package cosmos.kv;
option go_package = "github.com/cosmos/cosmos-sdk/types/kv";
// Key-Value Pair
message Pair {
bytes key = 1;
bytes value = 2;
}

View File

@ -4,14 +4,12 @@ package ibc.transfer;
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types";
import "gogoproto/gogo.proto";
import "cosmos/cosmos.proto";
import "ibc/transfer/transfer.proto";
// GenesisState is currently only used to ensure that the InitGenesis gets run
// by the module manager
message GenesisState{
string port_id = 1 [
(gogoproto.customname) = "PortID",
(gogoproto.moretags) = "yaml:\"port_id\""
];
message GenesisState {
string port_id = 1 [
(gogoproto.customname) = "PortID",
(gogoproto.moretags) = "yaml:\"port_id\""
];
}

View File

@ -5,13 +5,13 @@ import (
"fmt"
"io/ioutil"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp/helpers"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
)
@ -109,7 +109,7 @@ func PrintStats(db dbm.DB) {
// GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on the
// each's module store key and the prefix bytes of the KVPair's key.
func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []tmkv.Pair) (log string) {
func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string) {
for i := 0; i < len(kvAs); i++ {
if len(kvAs[i].Value) == 0 && len(kvBs[i].Value) == 0 {
// skip if the value doesn't have any bytes

View File

@ -4,12 +4,11 @@ import (
"fmt"
"testing"
"github.com/cosmos/cosmos-sdk/std"
"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/std"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)
@ -17,26 +16,26 @@ func TestGetSimulationLog(t *testing.T) {
cdc := std.MakeCodec(ModuleBasics)
decoders := make(sdk.StoreDecoderRegistry)
decoders[authtypes.StoreKey] = func(kvAs, kvBs tmkv.Pair) string { return "10" }
decoders[authtypes.StoreKey] = func(kvAs, kvBs kv.Pair) string { return "10" }
tests := []struct {
store string
kvPairs []tmkv.Pair
kvPairs []kv.Pair
expectedLog string
}{
{
"Empty",
[]tmkv.Pair{{}},
[]kv.Pair{{}},
"",
},
{
authtypes.StoreKey,
[]tmkv.Pair{{Key: authtypes.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryBare(uint64(10))}},
[]kv.Pair{{Key: authtypes.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryBare(uint64(10))}},
"10",
},
{
"OtherStore",
[]tmkv.Pair{{Key: []byte("key"), Value: []byte("value")}},
[]kv.Pair{{Key: []byte("key"), Value: []byte("value")}},
fmt.Sprintf("store A %X => %X\nstore B %X => %X\n", []byte("key"), []byte("value"), []byte("key"), []byte("value")),
},
}

View File

@ -4,7 +4,7 @@ import (
"container/list"
"errors"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/types/kv"
dbm "github.com/tendermint/tm-db"
)
@ -13,17 +13,17 @@ import (
// Implements Iterator.
type memIterator struct {
start, end []byte
items []*tmkv.Pair
items []*kv.Pair
ascending bool
}
func newMemIterator(start, end []byte, items *list.List, ascending bool) *memIterator {
itemsInDomain := make([]*tmkv.Pair, 0)
itemsInDomain := make([]*kv.Pair, 0)
var entered bool
for e := items.Front(); e != nil; e = e.Next() {
item := e.Value.(*tmkv.Pair)
item := e.Value.(*kv.Pair)
if !dbm.IsKeyInDomain(item.Key, start, end) {
if entered {
break

View File

@ -8,12 +8,12 @@ import (
"sync"
"time"
tmkv "github.com/tendermint/tendermint/libs/kv"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/store/tracekv"
"github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/telemetry"
"github.com/cosmos/cosmos-sdk/types/kv"
)
// If value is nil but deleted is false, it means the parent doesn't have the
@ -181,13 +181,13 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator {
// Constructs a slice of dirty items, to use w/ memIterator.
func (store *Store) dirtyItems(start, end []byte) {
unsorted := make([]*tmkv.Pair, 0)
unsorted := make([]*kv.Pair, 0)
for key := range store.unsortedCache {
cacheValue := store.cache[key]
if dbm.IsKeyInDomain([]byte(key), start, end) {
unsorted = append(unsorted, &tmkv.Pair{Key: []byte(key), Value: cacheValue.value})
unsorted = append(unsorted, &kv.Pair{Key: []byte(key), Value: cacheValue.value})
delete(store.unsortedCache, key)
}
@ -199,7 +199,7 @@ func (store *Store) dirtyItems(start, end []byte) {
for e := store.sortedCache.Front(); e != nil && len(unsorted) != 0; {
uitem := unsorted[0]
sitem := e.Value.(*tmkv.Pair)
sitem := e.Value.(*kv.Pair)
comp := bytes.Compare(uitem.Key, sitem.Key)
switch comp {

View File

@ -3,28 +3,27 @@ package store
import (
"bytes"
tmkv "github.com/tendermint/tendermint/libs/kv"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkkv "github.com/cosmos/cosmos-sdk/types/kv"
)
// Gets the first item.
func First(st KVStore, start, end []byte) (kv tmkv.Pair, ok bool) {
func First(st KVStore, start, end []byte) (kv sdkkv.Pair, ok bool) {
iter := st.Iterator(start, end)
if !iter.Valid() {
return kv, false
}
defer iter.Close()
return tmkv.Pair{Key: iter.Key(), Value: iter.Value()}, true
return sdkkv.Pair{Key: iter.Key(), Value: iter.Value()}, true
}
// Gets the last item. `end` is exclusive.
func Last(st KVStore, start, end []byte) (kv tmkv.Pair, ok bool) {
func Last(st KVStore, start, end []byte) (kv sdkkv.Pair, ok bool) {
iter := st.ReverseIterator(end, start)
if !iter.Valid() {
if v := st.Get(start); v != nil {
return tmkv.Pair{Key: sdk.CopyBytes(start), Value: sdk.CopyBytes(v)}, true
return sdkkv.Pair{Key: sdk.CopyBytes(start), Value: sdk.CopyBytes(v)}, true
}
return kv, false
}
@ -38,5 +37,5 @@ func Last(st KVStore, start, end []byte) (kv tmkv.Pair, ok bool) {
}
}
return tmkv.Pair{Key: iter.Key(), Value: iter.Value()}, true
return sdkkv.Pair{Key: iter.Key(), Value: iter.Value()}, true
}

View File

@ -11,7 +11,6 @@ import (
"github.com/tendermint/iavl"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/merkle"
tmkv "github.com/tendermint/tendermint/libs/kv"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/store/cachekv"
@ -20,6 +19,7 @@ import (
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/kv"
)
const (
@ -333,7 +333,7 @@ type iavlIterator struct {
tree *iavl.ImmutableTree
// Channel to push iteration values.
iterCh chan tmkv.Pair
iterCh chan kv.Pair
// Close this to release goroutine.
quitCh chan struct{}
@ -359,7 +359,7 @@ func newIAVLIterator(tree *iavl.ImmutableTree, start, end []byte, ascending bool
start: sdk.CopyBytes(start),
end: sdk.CopyBytes(end),
ascending: ascending,
iterCh: make(chan tmkv.Pair), // Set capacity > 0?
iterCh: make(chan kv.Pair), // Set capacity > 0?
quitCh: make(chan struct{}),
initCh: make(chan struct{}),
}
@ -376,7 +376,7 @@ func (iter *iavlIterator) iterateRoutine() {
select {
case <-iter.quitCh:
return true // done with iteration.
case iter.iterCh <- tmkv.Pair{Key: key, Value: value}:
case iter.iterCh <- kv.Pair{Key: key, Value: value}:
return false // yay.
}
},

View File

@ -5,9 +5,9 @@ import (
"github.com/tendermint/tendermint/crypto/merkle"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/types/kv"
)
// merkleMap defines a merkle-ized tree from a map. Leave values are treated as

View File

@ -5,8 +5,9 @@ import (
"io"
abci "github.com/tendermint/tendermint/abci/types"
tmkv "github.com/tendermint/tendermint/libs/kv"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/types/kv"
)
type Store interface {
@ -381,7 +382,7 @@ func (key *MemoryStoreKey) String() string {
//----------------------------------------
// key-value result for iterator queries
type KVPair tmkv.Pair
type KVPair kv.Pair
//----------------------------------------

View File

@ -3,7 +3,7 @@ package types
import (
"bytes"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/types/kv"
)
// Iterator over all the keys with a certain prefix in ascending order
@ -18,7 +18,7 @@ func KVStoreReversePrefixIterator(kvs KVStore, prefix []byte) Iterator {
// DiffKVStores compares two KVstores and returns all the key/value pairs
// that differ from one another. It also skips value comparison for a set of provided prefixes.
func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvAs, kvBs []tmkv.Pair) {
func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvAs, kvBs []kv.Pair) {
iterA := a.Iterator(nil, nil)
defer iterA.Close()
@ -32,15 +32,15 @@ func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvAs, kvBs []t
return kvAs, kvBs
}
var kvA, kvB tmkv.Pair
var kvA, kvB kv.Pair
if iterA.Valid() {
kvA = tmkv.Pair{Key: iterA.Key(), Value: iterA.Value()}
kvA = kv.Pair{Key: iterA.Key(), Value: iterA.Value()}
iterA.Next()
}
if iterB.Valid() {
kvB = tmkv.Pair{Key: iterB.Key(), Value: iterB.Value()}
kvB = kv.Pair{Key: iterB.Key(), Value: iterB.Value()}
iterB.Next()
}

View File

@ -1608,7 +1608,7 @@ type TestVersion2 struct {
// *TestVersion2_F
Sum isTestVersion2_Sum `protobuf_oneof:"sum"`
G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
H []*TestVersion2 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
// google.protobuf.Timestamp i = 10;
// google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true];
*Customer1 `protobuf:"bytes,12,opt,name=k,proto3,embedded=k" json:"k,omitempty"`
@ -1727,7 +1727,7 @@ func (m *TestVersion2) GetG() *types.Any {
return nil
}
func (m *TestVersion2) GetH() []*TestVersion2 {
func (m *TestVersion2) GetH() []*TestVersion1 {
if m != nil {
return m.H
}
@ -3150,112 +3150,111 @@ func init() {
func init() { proto.RegisterFile("proto.proto", fileDescriptor_2fcc84b9998d60d8) }
var fileDescriptor_2fcc84b9998d60d8 = []byte{
// 1669 bytes of a gzipped FileDescriptorProto
// 1664 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6f, 0x23, 0x49,
0x15, 0x4e, 0xb9, 0xed, 0xc4, 0x7e, 0x31, 0x8e, 0x29, 0xc2, 0xd2, 0xe3, 0x65, 0x33, 0xa1, 0x35,
0xec, 0x98, 0xd5, 0x8e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x65, 0x9e, 0x15, 0x23, 0xbf, 0xc4, 0x6e, 0xdd,
0x98, 0xf3, 0x24, 0x19, 0x3f, 0x38, 0xfc, 0xfc, 0xe5, 0x16, 0x7a, 0xfe, 0x72, 0x0b, 0xfd, 0xed,
0xe5, 0x16, 0xfa, 0xf5, 0xab, 0xad, 0x95, 0xe7, 0xaf, 0xb6, 0x56, 0xfe, 0xf2, 0x6a, 0x6b, 0xe5,
0xd3, 0xce, 0xc5, 0xb7, 0xcb, 0x54, 0x46, 0xd3, 0x88, 0x05, 0x3b, 0x29, 0xf3, 0x70, 0x35, 0x96,
0xb1, 0xfb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x62, 0xd0, 0xa8, 0x05, 0x79, 0x19, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -10935,7 +10934,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.H = append(m.H, &TestVersion2{})
m.H = append(m.H, &TestVersion1{})
if err := m.H[len(m.H)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

36
types/kv/kv.go Normal file
View File

@ -0,0 +1,36 @@
package kv
import (
"bytes"
"sort"
)
//----------------------------------------
// KVPair
/*
Defined in types.proto
type Pair struct {
Key []byte
Value []byte
}
*/
type Pairs []Pair
// Sorting
func (kvs Pairs) Len() int { return len(kvs) }
func (kvs Pairs) Less(i, j int) bool {
switch bytes.Compare(kvs[i].Key, kvs[j].Key) {
case -1:
return true
case 0:
return bytes.Compare(kvs[i].Value, kvs[j].Value) < 0
case 1:
return false
default:
panic("invalid comparison result")
}
}
func (kvs Pairs) Swap(i, j int) { kvs[i], kvs[j] = kvs[j], kvs[i] }
func (kvs Pairs) Sort() { sort.Sort(kvs) }

373
types/kv/kv.pb.go Normal file
View File

@ -0,0 +1,373 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/kv/kv.proto
package kv
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Key-Value Pair
type Pair struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (m *Pair) Reset() { *m = Pair{} }
func (m *Pair) String() string { return proto.CompactTextString(m) }
func (*Pair) ProtoMessage() {}
func (*Pair) Descriptor() ([]byte, []int) {
return fileDescriptor_23371bd43b515c6e, []int{0}
}
func (m *Pair) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Pair.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Pair) XXX_Merge(src proto.Message) {
xxx_messageInfo_Pair.Merge(m, src)
}
func (m *Pair) XXX_Size() int {
return m.Size()
}
func (m *Pair) XXX_DiscardUnknown() {
xxx_messageInfo_Pair.DiscardUnknown(m)
}
var xxx_messageInfo_Pair proto.InternalMessageInfo
func (m *Pair) GetKey() []byte {
if m != nil {
return m.Key
}
return nil
}
func (m *Pair) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
func init() {
proto.RegisterType((*Pair)(nil), "cosmos.kv.Pair")
}
func init() { proto.RegisterFile("cosmos/kv/kv.proto", fileDescriptor_23371bd43b515c6e) }
var fileDescriptor_23371bd43b515c6e = []byte{
// 150 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0xce, 0x2f, 0xce,
0xcd, 0x2f, 0xd6, 0xcf, 0x2e, 0xd3, 0xcf, 0x2e, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2,
0x84, 0x88, 0xe9, 0x65, 0x97, 0x29, 0xe9, 0x71, 0xb1, 0x04, 0x24, 0x66, 0x16, 0x09, 0x09, 0x70,
0x31, 0x67, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0x81, 0x98, 0x42, 0x22, 0x5c,
0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, 0x60, 0x31, 0x08, 0xc7, 0xc9, 0xfe, 0xc4, 0x23,
0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2,
0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x54, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4,
0x92, 0xf3, 0x73, 0xf5, 0xa1, 0x76, 0x42, 0x28, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x92, 0xca, 0x82,
0x54, 0x90, 0x23, 0x92, 0xd8, 0xc0, 0x4e, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xae, 0xee,
0xa2, 0x4c, 0x98, 0x00, 0x00, 0x00,
}
func (m *Pair) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Pair) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Value) > 0 {
i -= len(m.Value)
copy(dAtA[i:], m.Value)
i = encodeVarintKv(dAtA, i, uint64(len(m.Value)))
i--
dAtA[i] = 0x12
}
if len(m.Key) > 0 {
i -= len(m.Key)
copy(dAtA[i:], m.Key)
i = encodeVarintKv(dAtA, i, uint64(len(m.Key)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintKv(dAtA []byte, offset int, v uint64) int {
offset -= sovKv(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Pair) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Key)
if l > 0 {
n += 1 + l + sovKv(uint64(l))
}
l = len(m.Value)
if l > 0 {
n += 1 + l + sovKv(uint64(l))
}
return n
}
func sovKv(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozKv(x uint64) (n int) {
return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Pair) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKv
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Pair: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKv
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthKv
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthKv
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
if m.Key == nil {
m.Key = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKv
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthKv
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthKv
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
if m.Value == nil {
m.Value = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipKv(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthKv
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthKv
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipKv(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowKv
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowKv
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowKv
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthKv
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupKv
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthKv
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowKv = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupKv = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -1,9 +1,8 @@
package types
import (
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/types/kv"
)
type (
@ -25,7 +24,7 @@ type (
// StoreDecoderRegistry defines each of the modules store decoders. Used for ImportExport
// simulation.
type StoreDecoderRegistry map[string]func(kvA, kvB tmkv.Pair) string
type StoreDecoderRegistry map[string]func(kvA, kvB kv.Pair) string
// Iterator over all the keys with a certain prefix in ascending order
func KVStorePrefixIterator(kvs KVStore, prefix []byte) Iterator {
@ -51,7 +50,7 @@ func KVStoreReversePrefixIteratorPaginated(kvs KVStore, prefix []byte, page, lim
// DiffKVStores compares two KVstores and returns all the key/value pairs
// that differ from one another. It also skips value comparison for a set of provided prefixes
func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvAs, kvBs []tmkv.Pair) {
func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvAs, kvBs []kv.Pair) {
return types.DiffKVStores(a, b, prefixesToSkip)
}

View File

@ -113,9 +113,8 @@ func (m *SignatureDescriptors) GetSignatures() []*SignatureDescriptor {
// itself. It is primarily used for coordinating signatures between clients.
type SignatureDescriptor struct {
// public_key is the public key of the signer
PublicKey *types.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
// data represents the signature data
Data *SignatureDescriptor_Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
PublicKey *types.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
Data *SignatureDescriptor_Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}
func (m *SignatureDescriptor) Reset() { *m = SignatureDescriptor{} }
@ -165,6 +164,7 @@ func (m *SignatureDescriptor) GetData() *SignatureDescriptor_Data {
return nil
}
// Data represents signature data
type SignatureDescriptor_Data struct {
// sum is the oneof that specifies whether this represents single or multi-signature data
//

View File

@ -5,9 +5,9 @@ import (
"fmt"
gogotypes "github.com/gogo/protobuf/types"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/auth/types"
)
@ -18,8 +18,8 @@ type AuthUnmarshaler interface {
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding auth type.
func NewDecodeStore(ak AuthUnmarshaler) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(ak AuthUnmarshaler) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key[:1], types.AddressStoreKeyPrefix):
accA, err := ak.UnmarshalAccount(kvA.Value)

View File

@ -7,10 +7,10 @@ import (
gogotypes "github.com/gogo/protobuf/types"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/ed25519"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/auth/simulation"
"github.com/cosmos/cosmos-sdk/x/auth/types"
)
@ -31,16 +31,16 @@ func TestDecodeStore(t *testing.T) {
globalAccNumber := gogotypes.UInt64Value{Value: 10}
kvPairs := tmkv.Pairs{
tmkv.Pair{
kvPairs := kv.Pairs{
kv.Pair{
Key: types.AddressStoreKey(delAddr1),
Value: accBz,
},
tmkv.Pair{
kv.Pair{
Key: types.GlobalAccountNumberKey,
Value: cdc.MustMarshalBinaryBare(&globalAccNumber),
},
tmkv.Pair{
kv.Pair{
Key: []byte{0x99},
Value: []byte{0x99},
},

View File

@ -4,10 +4,8 @@ import (
"bytes"
"fmt"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/bank/exported"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/x/bank/types"
)
@ -17,8 +15,8 @@ type SupplyUnmarshaller interface {
// NewDecodeStore returns a function closure that unmarshals the KVPair's values
// to the corresponding types.
func NewDecodeStore(cdc SupplyUnmarshaller) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc SupplyUnmarshaller) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key[:1], types.SupplyKey):
supplyA, err := cdc.UnmarshalSupply(kvA.Value)

View File

@ -5,10 +5,10 @@ import (
"testing"
"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/bank/simulation"
"github.com/cosmos/cosmos-sdk/x/bank/types"
)
@ -22,9 +22,9 @@ func TestDecodeStore(t *testing.T) {
supplyBz, err := app.BankKeeper.MarshalSupply(totalSupply)
require.NoError(t, err)
kvPairs := tmkv.Pairs{
tmkv.Pair{Key: types.SupplyKey, Value: supplyBz},
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
kvPairs := kv.Pairs{
kv.Pair{Key: types.SupplyKey, Value: supplyBz},
kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
}
tests := []struct {

View File

@ -4,17 +4,16 @@ import (
"bytes"
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/capability/types"
)
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding capaility type.
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key, types.KeyIndex):
idxA := sdk.BigEndianToUint64(kvA.Value)

View File

@ -5,10 +5,10 @@ import (
"testing"
"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/capability/simulation"
"github.com/cosmos/cosmos-sdk/x/capability/types"
)
@ -21,16 +21,16 @@ func TestDecodeStore(t *testing.T) {
Owners: []types.Owner{{Module: "transfer", Name: "ports/transfer"}},
}
kvPairs := tmkv.Pairs{
tmkv.Pair{
kvPairs := kv.Pairs{
kv.Pair{
Key: types.KeyIndex,
Value: sdk.Uint64ToBigEndian(10),
},
tmkv.Pair{
kv.Pair{
Key: types.KeyPrefixIndexCapability,
Value: cdc.MustMarshalBinaryBare(&capOwners),
},
tmkv.Pair{
kv.Pair{
Key: []byte{0x99},
Value: []byte{0x99},
},

View File

@ -4,17 +4,16 @@ import (
"bytes"
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/distribution/types"
)
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding distribution type.
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key[:1], types.FeePoolKey):
var feePoolA, feePoolB types.FeePool

View File

@ -5,12 +5,11 @@ import (
"testing"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/ed25519"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/distribution/simulation"
"github.com/cosmos/cosmos-sdk/x/distribution/types"
)
@ -36,17 +35,17 @@ func TestDecodeDistributionStore(t *testing.T) {
currentRewards := types.NewValidatorCurrentRewards(decCoins, 5)
slashEvent := types.NewValidatorSlashEvent(10, sdk.OneDec())
kvPairs := tmkv.Pairs{
tmkv.Pair{Key: types.FeePoolKey, Value: cdc.MustMarshalBinaryBare(&feePool)},
tmkv.Pair{Key: types.ProposerKey, Value: consAddr1.Bytes()},
tmkv.Pair{Key: types.GetValidatorOutstandingRewardsKey(valAddr1), Value: cdc.MustMarshalBinaryBare(&outstanding)},
tmkv.Pair{Key: types.GetDelegatorWithdrawAddrKey(delAddr1), Value: delAddr1.Bytes()},
tmkv.Pair{Key: types.GetDelegatorStartingInfoKey(valAddr1, delAddr1), Value: cdc.MustMarshalBinaryBare(&info)},
tmkv.Pair{Key: types.GetValidatorHistoricalRewardsKey(valAddr1, 100), Value: cdc.MustMarshalBinaryBare(&historicalRewards)},
tmkv.Pair{Key: types.GetValidatorCurrentRewardsKey(valAddr1), Value: cdc.MustMarshalBinaryBare(&currentRewards)},
tmkv.Pair{Key: types.GetValidatorAccumulatedCommissionKey(valAddr1), Value: cdc.MustMarshalBinaryBare(&commission)},
tmkv.Pair{Key: types.GetValidatorSlashEventKeyPrefix(valAddr1, 13), Value: cdc.MustMarshalBinaryBare(&slashEvent)},
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
kvPairs := kv.Pairs{
kv.Pair{Key: types.FeePoolKey, Value: cdc.MustMarshalBinaryBare(&feePool)},
kv.Pair{Key: types.ProposerKey, Value: consAddr1.Bytes()},
kv.Pair{Key: types.GetValidatorOutstandingRewardsKey(valAddr1), Value: cdc.MustMarshalBinaryBare(&outstanding)},
kv.Pair{Key: types.GetDelegatorWithdrawAddrKey(delAddr1), Value: delAddr1.Bytes()},
kv.Pair{Key: types.GetDelegatorStartingInfoKey(valAddr1, delAddr1), Value: cdc.MustMarshalBinaryBare(&info)},
kv.Pair{Key: types.GetValidatorHistoricalRewardsKey(valAddr1, 100), Value: cdc.MustMarshalBinaryBare(&historicalRewards)},
kv.Pair{Key: types.GetValidatorCurrentRewardsKey(valAddr1), Value: cdc.MustMarshalBinaryBare(&currentRewards)},
kv.Pair{Key: types.GetValidatorAccumulatedCommissionKey(valAddr1), Value: cdc.MustMarshalBinaryBare(&commission)},
kv.Pair{Key: types.GetValidatorSlashEventKeyPrefix(valAddr1, 13), Value: cdc.MustMarshalBinaryBare(&slashEvent)},
kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
}
tests := []struct {

View File

@ -4,10 +4,8 @@ import (
"bytes"
"fmt"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/evidence/exported"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/x/evidence/types"
)
@ -17,8 +15,8 @@ type EvidenceUnmarshaler interface {
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding evidence type.
func NewDecodeStore(cdc EvidenceUnmarshaler) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc EvidenceUnmarshaler) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key[:1], types.KeyPrefixEvidence):
evidenceA, err := cdc.UnmarshalEvidence(kvA.Value)

View File

@ -7,10 +7,10 @@ import (
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/ed25519"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/evidence/simulation"
"github.com/cosmos/cosmos-sdk/x/evidence/types"
)
@ -31,12 +31,12 @@ func TestDecodeStore(t *testing.T) {
evBz, err := app.EvidenceKeeper.MarshalEvidence(ev)
require.NoError(t, err)
kvPairs := tmkv.Pairs{
tmkv.Pair{
kvPairs := kv.Pairs{
kv.Pair{
Key: types.KeyPrefixEvidence,
Value: evBz,
},
tmkv.Pair{
kv.Pair{
Key: []byte{0x99},
Value: []byte{0x99},
},

View File

@ -5,16 +5,15 @@ import (
"encoding/binary"
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding gov type.
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key[:1], types.ProposalsKeyPrefix):
var proposalA types.Proposal

View File

@ -7,12 +7,11 @@ import (
"time"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/ed25519"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/gov/simulation"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)
@ -40,12 +39,12 @@ func TestDecodeStore(t *testing.T) {
proposalBz, err := cdc.MarshalBinaryBare(&proposal)
require.NoError(t, err)
kvPairs := tmkv.Pairs{
tmkv.Pair{Key: types.ProposalKey(1), Value: proposalBz},
tmkv.Pair{Key: types.InactiveProposalQueueKey(1, endTime), Value: proposalIDBz},
tmkv.Pair{Key: types.DepositKey(1, delAddr1), Value: cdc.MustMarshalBinaryBare(&deposit)},
tmkv.Pair{Key: types.VoteKey(1, delAddr1), Value: cdc.MustMarshalBinaryBare(&vote)},
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
kvPairs := kv.Pairs{
kv.Pair{Key: types.ProposalKey(1), Value: proposalBz},
kv.Pair{Key: types.InactiveProposalQueueKey(1, endTime), Value: proposalIDBz},
kv.Pair{Key: types.DepositKey(1, delAddr1), Value: cdc.MustMarshalBinaryBare(&deposit)},
kv.Pair{Key: types.VoteKey(1, delAddr1), Value: cdc.MustMarshalBinaryBare(&vote)},
kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
}
tests := []struct {

View File

@ -5,7 +5,6 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-sdk/types"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
@ -77,21 +76,20 @@ func init() {
func init() { proto.RegisterFile("ibc/transfer/genesis.proto", fileDescriptor_c13b8463155e05c2) }
var fileDescriptor_c13b8463155e05c2 = []byte{
// 218 bytes of a gzipped FileDescriptorProto
// 204 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x4c, 0x4a, 0xd6,
0x2f, 0x29, 0x4a, 0xcc, 0x2b, 0x4e, 0x4b, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c,
0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xc9, 0x4c, 0x4a, 0xd6, 0x83, 0xc9, 0x49, 0x89,
0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf4, 0x41, 0x2c, 0x88, 0x1a, 0x29, 0xe1, 0xe4, 0xfc, 0xe2,
0xdc, 0xfc, 0x62, 0x7d, 0x08, 0x05, 0x15, 0x94, 0x46, 0x31, 0x14, 0xc6, 0x80, 0x48, 0x2a, 0xb9,
0x72, 0xf1, 0xb8, 0x43, 0xac, 0x09, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x32, 0xe5, 0x62, 0x2f, 0xc8,
0x2f, 0x2a, 0x89, 0xcf, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x92, 0x79, 0x74, 0x4f,
0x9e, 0x2d, 0x20, 0xbf, 0xa8, 0xc4, 0xd3, 0xe5, 0xd3, 0x3d, 0x79, 0xbe, 0xca, 0xc4, 0xdc, 0x1c,
0x2b, 0x25, 0xa8, 0x12, 0xa5, 0x20, 0x36, 0x10, 0xcb, 0x33, 0xc5, 0xc9, 0xfb, 0xc4, 0x23, 0x39,
0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63,
0x39, 0x86, 0x1b, 0x8f, 0xe5, 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x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0x9a, 0x31, 0x20,
0x00, 0x00, 0xff, 0xff, 0x2e, 0x43, 0x78, 0xc7, 0xdc, 0x00, 0x00, 0x00,
}
func (m *GenesisState) Marshal() (dAtA []byte, err error) {

View File

@ -4,16 +4,15 @@ import (
"bytes"
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/ibc/02-client/exported"
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
)
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding client type.
func NewDecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) (string, bool) {
func NewDecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) (string, bool) {
switch {
case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.HasSuffix(kvA.Key, host.KeyClientState()):
var clientStateA, clientStateB exported.ClientState

View File

@ -6,9 +6,9 @@ import (
"time"
"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/ibc/02-client/exported"
"github.com/cosmos/cosmos-sdk/x/ibc/02-client/simulation"
ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/07-tendermint/types"
@ -29,20 +29,20 @@ func TestDecodeStore(t *testing.T) {
Timestamp: time.Now().UTC(),
}
kvPairs := tmkv.Pairs{
tmkv.Pair{
kvPairs := kv.Pairs{
kv.Pair{
Key: host.FullKeyClientPath(clientID, host.KeyClientState()),
Value: cdc.MustMarshalBinaryBare(clientState),
},
tmkv.Pair{
kv.Pair{
Key: host.FullKeyClientPath(clientID, host.KeyClientType()),
Value: []byte(exported.Tendermint.String()),
},
tmkv.Pair{
kv.Pair{
Key: host.FullKeyClientPath(clientID, host.KeyConsensusState(10)),
Value: cdc.MustMarshalBinaryBare(consState),
},
tmkv.Pair{
kv.Pair{
Key: []byte{0x99},
Value: []byte{0x99},
},

View File

@ -4,16 +4,15 @@ import (
"bytes"
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types"
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
)
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding connection type.
func NewDecodeStore(cdc codec.BinaryMarshaler, kvA, kvB tmkv.Pair) (string, bool) {
func NewDecodeStore(cdc codec.BinaryMarshaler, kvA, kvB kv.Pair) (string, bool) {
switch {
case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.HasSuffix(kvA.Key, host.KeyConnectionPrefix):
var clientConnectionsA, clientConnectionsB types.ClientPaths

View File

@ -5,9 +5,9 @@ import (
"testing"
"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/ibc/03-connection/simulation"
"github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types"
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
@ -28,16 +28,16 @@ func TestDecodeStore(t *testing.T) {
Paths: []string{connectionID},
}
kvPairs := tmkv.Pairs{
tmkv.Pair{
kvPairs := kv.Pairs{
kv.Pair{
Key: host.KeyClientConnections(connection.ClientID),
Value: cdc.MustMarshalBinaryBare(&paths),
},
tmkv.Pair{
kv.Pair{
Key: host.KeyConnection(connectionID),
Value: cdc.MustMarshalBinaryBare(&connection),
},
tmkv.Pair{
kv.Pair{
Key: []byte{0x99},
Value: []byte{0x99},
},

View File

@ -4,17 +4,16 @@ import (
"bytes"
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
)
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding channel type.
func NewDecodeStore(cdc codec.BinaryMarshaler, kvA, kvB tmkv.Pair) (string, bool) {
func NewDecodeStore(cdc codec.BinaryMarshaler, kvA, kvB kv.Pair) (string, bool) {
switch {
case bytes.HasPrefix(kvA.Key, []byte(host.KeyChannelPrefix)):
var channelA, channelB types.Channel

View File

@ -5,10 +5,10 @@ import (
"testing"
"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/ibc/04-channel/simulation"
"github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
@ -28,32 +28,32 @@ func TestDecodeStore(t *testing.T) {
bz := []byte{0x1, 0x2, 0x3}
kvPairs := tmkv.Pairs{
tmkv.Pair{
kvPairs := kv.Pairs{
kv.Pair{
Key: host.KeyChannel(portID, channelID),
Value: cdc.MustMarshalBinaryBare(&channel),
},
tmkv.Pair{
kv.Pair{
Key: host.KeyNextSequenceSend(portID, channelID),
Value: sdk.Uint64ToBigEndian(1),
},
tmkv.Pair{
kv.Pair{
Key: host.KeyNextSequenceRecv(portID, channelID),
Value: sdk.Uint64ToBigEndian(1),
},
tmkv.Pair{
kv.Pair{
Key: host.KeyNextSequenceAck(portID, channelID),
Value: sdk.Uint64ToBigEndian(1),
},
tmkv.Pair{
kv.Pair{
Key: host.KeyPacketCommitment(portID, channelID, 1),
Value: bz,
},
tmkv.Pair{
kv.Pair{
Key: host.KeyPacketAcknowledgement(portID, channelID, 1),
Value: bz,
},
tmkv.Pair{
kv.Pair{
Key: []byte{0x99},
Value: []byte{0x99},
},

View File

@ -3,9 +3,8 @@ package simulation
import (
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
clientsim "github.com/cosmos/cosmos-sdk/x/ibc/02-client/simulation"
connectionsim "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/simulation"
channelsim "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/simulation"
@ -14,8 +13,8 @@ import (
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding ibc type.
func NewDecodeStore(cdc codec.BinaryMarshaler, aminoCdc *codec.Codec) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc codec.BinaryMarshaler, aminoCdc *codec.Codec) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
if res, found := clientsim.NewDecodeStore(aminoCdc, kvA, kvB); found {
return res
}

View File

@ -5,9 +5,9 @@ import (
"testing"
"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/types/kv"
connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types"
channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/07-tendermint/types"
@ -39,20 +39,20 @@ func TestDecodeStore(t *testing.T) {
Version: "1.0",
}
kvPairs := tmkv.Pairs{
tmkv.Pair{
kvPairs := kv.Pairs{
kv.Pair{
Key: host.FullKeyClientPath(clientID, host.KeyClientState()),
Value: aminoCdc.MustMarshalBinaryBare(clientState),
},
tmkv.Pair{
kv.Pair{
Key: host.KeyConnection(connectionID),
Value: cdc.MustMarshalBinaryBare(&connection),
},
tmkv.Pair{
kv.Pair{
Key: host.KeyChannel(portID, channelID),
Value: cdc.MustMarshalBinaryBare(&channel),
},
tmkv.Pair{
kv.Pair{
Key: []byte{0x99},
Value: []byte{0x99},
},

View File

@ -4,16 +4,15 @@ import (
"bytes"
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/mint/types"
)
// NewDecodeStore returns a decoder function closure that umarshals the KVPair's
// Value to the corresponding mint type.
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key, types.MinterKey):
var minterA, minterB types.Minter

View File

@ -6,10 +6,9 @@ import (
"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/mint/simulation"
"github.com/cosmos/cosmos-sdk/x/mint/types"
)
@ -20,9 +19,9 @@ func TestDecodeStore(t *testing.T) {
minter := types.NewMinter(sdk.OneDec(), sdk.NewDec(15))
kvPairs := tmkv.Pairs{
tmkv.Pair{Key: types.MinterKey, Value: cdc.MustMarshalBinaryBare(&minter)},
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
kvPairs := kv.Pairs{
kv.Pair{Key: types.MinterKey, Value: cdc.MustMarshalBinaryBare(&minter)},
kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
}
tests := []struct {
name string

View File

@ -5,16 +5,16 @@ import (
"fmt"
gogotypes "github.com/gogo/protobuf/types"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding slashing type.
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key[:1], types.ValidatorSigningInfoKeyPrefix):
var infoA, infoB types.ValidatorSigningInfo

View File

@ -6,14 +6,12 @@ import (
"time"
gogotypes "github.com/gogo/protobuf/types"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/ed25519"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/slashing/simulation"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)
@ -34,11 +32,11 @@ func TestDecodeStore(t *testing.T) {
bechPK := sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, delPk1)
missed := gogotypes.BoolValue{Value: true}
kvPairs := tmkv.Pairs{
tmkv.Pair{Key: types.ValidatorSigningInfoKey(consAddr1), Value: cdc.MustMarshalBinaryBare(&info)},
tmkv.Pair{Key: types.ValidatorMissedBlockBitArrayKey(consAddr1, 6), Value: cdc.MustMarshalBinaryBare(&missed)},
tmkv.Pair{Key: types.AddrPubkeyRelationKey(delAddr1), Value: cdc.MustMarshalBinaryBare(&gogotypes.StringValue{Value: bechPK})},
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
kvPairs := kv.Pairs{
kv.Pair{Key: types.ValidatorSigningInfoKey(consAddr1), Value: cdc.MustMarshalBinaryBare(&info)},
kv.Pair{Key: types.ValidatorMissedBlockBitArrayKey(consAddr1, 6), Value: cdc.MustMarshalBinaryBare(&missed)},
kv.Pair{Key: types.AddrPubkeyRelationKey(delAddr1), Value: cdc.MustMarshalBinaryBare(&gogotypes.StringValue{Value: bechPK})},
kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
}
tests := []struct {

View File

@ -4,17 +4,16 @@ import (
"bytes"
"fmt"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
// Value to the corresponding staking type.
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB tmkv.Pair) string {
return func(kvA, kvB tmkv.Pair) string {
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string {
return func(kvA, kvB kv.Pair) string {
switch {
case bytes.Equal(kvA.Key[:1], types.LastTotalPowerKey):
var powerA, powerB sdk.IntProto

View File

@ -6,14 +6,13 @@ import (
"time"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/ed25519"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/x/staking/simulation"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
@ -43,14 +42,14 @@ func TestDecodeStore(t *testing.T) {
ubd := types.NewUnbondingDelegation(delAddr1, valAddr1, 15, bondTime, sdk.OneInt())
red := types.NewRedelegation(delAddr1, valAddr1, valAddr1, 12, bondTime, sdk.OneInt(), sdk.OneDec())
kvPairs := tmkv.Pairs{
tmkv.Pair{Key: types.LastTotalPowerKey, Value: cdc.MustMarshalBinaryBare(&sdk.IntProto{Int: sdk.OneInt()})},
tmkv.Pair{Key: types.GetValidatorKey(valAddr1), Value: cdc.MustMarshalBinaryBare(&val)},
tmkv.Pair{Key: types.LastValidatorPowerKey, Value: valAddr1.Bytes()},
tmkv.Pair{Key: types.GetDelegationKey(delAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(&del)},
tmkv.Pair{Key: types.GetUBDKey(delAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(&ubd)},
tmkv.Pair{Key: types.GetREDKey(delAddr1, valAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(&red)},
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
kvPairs := kv.Pairs{
kv.Pair{Key: types.LastTotalPowerKey, Value: cdc.MustMarshalBinaryBare(&sdk.IntProto{Int: sdk.OneInt()})},
kv.Pair{Key: types.GetValidatorKey(valAddr1), Value: cdc.MustMarshalBinaryBare(&val)},
kv.Pair{Key: types.LastValidatorPowerKey, Value: valAddr1.Bytes()},
kv.Pair{Key: types.GetDelegationKey(delAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(&del)},
kv.Pair{Key: types.GetUBDKey(delAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(&ubd)},
kv.Pair{Key: types.GetREDKey(delAddr1, valAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(&red)},
kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
}
tests := []struct {

File diff suppressed because it is too large Load Diff