diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index d031baa26..7ad7cab91 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -68,6 +68,9 @@ program](https://hackerone.com/tendermint). - [libs/common] \#3262 Make error the last parameter of `Task` (@PSalant726) - [cs/types] \#3262 Rename `GotVoteFromUnwantedRoundError` to `ErrGotVoteFromUnwantedRound` (@PSalant726) - [libs/common] \#3862 Remove `errors.go` from `libs/common` + - [libs/common] \#4230 Move `KV` out of common to its own pkg + - [libs/common] \#4230 Rename `cmn.KVPair(s)` to `kv.Pair(s)`s + - Blockchain Protocol diff --git a/Makefile b/Makefile index f440e945b..39ccc092b 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ get_deps_bin_size: ######################################## ### Libs -protoc_libs: libs/common/types.pb.go +protoc_libs: libs/kv/types.pb.go # generates certificates for TLS testing in remotedb and RPC server gen_certs: clean_certs diff --git a/UPGRADING.md b/UPGRADING.md index fc98982a7..3defa8ec8 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -61,7 +61,7 @@ Prior to the update, suppose your `ResponseDeliverTx` look like: ```go abci.ResponseDeliverTx{ - Tags: []cmn.KVPair{ + Tags: []kv.Pair{ {Key: []byte("sender"), Value: []byte("foo")}, {Key: []byte("recipient"), Value: []byte("bar")}, {Key: []byte("amount"), Value: []byte("35")}, @@ -85,7 +85,7 @@ abci.ResponseDeliverTx{ Events: []abci.Event{ { Type: "transfer", - Attributes: cmn.KVPairs{ + Attributes: kv.Pairs{ {Key: []byte("sender"), Value: []byte("foo")}, {Key: []byte("recipient"), Value: []byte("bar")}, {Key: []byte("amount"), Value: []byte("35")}, diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 963a0797e..b23563090 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -8,7 +8,7 @@ import ( "github.com/tendermint/tendermint/abci/example/code" "github.com/tendermint/tendermint/abci/types" - cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/libs/kv" "github.com/tendermint/tendermint/version" dbm "github.com/tendermint/tm-db" ) @@ -91,7 +91,7 @@ func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeli events := []types.Event{ { Type: "app", - Attributes: []cmn.KVPair{ + Attributes: []kv.Pair{ {Key: []byte("creator"), Value: []byte("Cosmoshi Netowoko")}, {Key: []byte("key"), Value: key}, }, diff --git a/abci/types/messages_test.go b/abci/types/messages_test.go index e0c0978ea..3aead256f 100644 --- a/abci/types/messages_test.go +++ b/abci/types/messages_test.go @@ -9,7 +9,7 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" - cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/libs/kv" ) func TestMarshalJSON(t *testing.T) { @@ -24,7 +24,7 @@ func TestMarshalJSON(t *testing.T) { Events: []Event{ { Type: "testEvent", - Attributes: []cmn.KVPair{ + Attributes: []kv.Pair{ {Key: []byte("pho"), Value: []byte("bo")}, }, }, @@ -91,7 +91,7 @@ func TestWriteReadMessage2(t *testing.T) { Events: []Event{ { Type: "testEvent", - Attributes: []cmn.KVPair{ + Attributes: []kv.Pair{ {Key: []byte("abc"), Value: []byte("def")}, }, }, diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 38103d33c..928529e01 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -13,7 +13,7 @@ import ( golang_proto "github.com/golang/protobuf/proto" _ "github.com/golang/protobuf/ptypes/timestamp" merkle "github.com/tendermint/tendermint/crypto/merkle" - common "github.com/tendermint/tendermint/libs/common" + kv "github.com/tendermint/tendermint/libs/kv" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -121,37 +121,37 @@ type isRequest_Value interface { } type Request_Echo struct { - Echo *RequestEcho `protobuf:"bytes,2,opt,name=echo,proto3,oneof"` + Echo *RequestEcho `protobuf:"bytes,2,opt,name=echo,proto3,oneof" json:"echo,omitempty"` } type Request_Flush struct { - Flush *RequestFlush `protobuf:"bytes,3,opt,name=flush,proto3,oneof"` + Flush *RequestFlush `protobuf:"bytes,3,opt,name=flush,proto3,oneof" json:"flush,omitempty"` } type Request_Info struct { - Info *RequestInfo `protobuf:"bytes,4,opt,name=info,proto3,oneof"` + Info *RequestInfo `protobuf:"bytes,4,opt,name=info,proto3,oneof" json:"info,omitempty"` } type Request_SetOption struct { - SetOption *RequestSetOption `protobuf:"bytes,5,opt,name=set_option,json=setOption,proto3,oneof"` + SetOption *RequestSetOption `protobuf:"bytes,5,opt,name=set_option,json=setOption,proto3,oneof" json:"set_option,omitempty"` } type Request_InitChain struct { - InitChain *RequestInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof"` + InitChain *RequestInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` } type Request_Query struct { - Query *RequestQuery `protobuf:"bytes,7,opt,name=query,proto3,oneof"` + Query *RequestQuery `protobuf:"bytes,7,opt,name=query,proto3,oneof" json:"query,omitempty"` } type Request_BeginBlock struct { - BeginBlock *RequestBeginBlock `protobuf:"bytes,8,opt,name=begin_block,json=beginBlock,proto3,oneof"` + BeginBlock *RequestBeginBlock `protobuf:"bytes,8,opt,name=begin_block,json=beginBlock,proto3,oneof" json:"begin_block,omitempty"` } type Request_CheckTx struct { - CheckTx *RequestCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof"` + CheckTx *RequestCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` } type Request_DeliverTx struct { - DeliverTx *RequestDeliverTx `protobuf:"bytes,19,opt,name=deliver_tx,json=deliverTx,proto3,oneof"` + DeliverTx *RequestDeliverTx `protobuf:"bytes,19,opt,name=deliver_tx,json=deliverTx,proto3,oneof" json:"deliver_tx,omitempty"` } type Request_EndBlock struct { - EndBlock *RequestEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,proto3,oneof"` + EndBlock *RequestEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,proto3,oneof" json:"end_block,omitempty"` } type Request_Commit struct { - Commit *RequestCommit `protobuf:"bytes,12,opt,name=commit,proto3,oneof"` + Commit *RequestCommit `protobuf:"bytes,12,opt,name=commit,proto3,oneof" json:"commit,omitempty"` } func (*Request_Echo) isRequest_Value() {} @@ -942,40 +942,40 @@ type isResponse_Value interface { } type Response_Exception struct { - Exception *ResponseException `protobuf:"bytes,1,opt,name=exception,proto3,oneof"` + Exception *ResponseException `protobuf:"bytes,1,opt,name=exception,proto3,oneof" json:"exception,omitempty"` } type Response_Echo struct { - Echo *ResponseEcho `protobuf:"bytes,2,opt,name=echo,proto3,oneof"` + Echo *ResponseEcho `protobuf:"bytes,2,opt,name=echo,proto3,oneof" json:"echo,omitempty"` } type Response_Flush struct { - Flush *ResponseFlush `protobuf:"bytes,3,opt,name=flush,proto3,oneof"` + Flush *ResponseFlush `protobuf:"bytes,3,opt,name=flush,proto3,oneof" json:"flush,omitempty"` } type Response_Info struct { - Info *ResponseInfo `protobuf:"bytes,4,opt,name=info,proto3,oneof"` + Info *ResponseInfo `protobuf:"bytes,4,opt,name=info,proto3,oneof" json:"info,omitempty"` } type Response_SetOption struct { - SetOption *ResponseSetOption `protobuf:"bytes,5,opt,name=set_option,json=setOption,proto3,oneof"` + SetOption *ResponseSetOption `protobuf:"bytes,5,opt,name=set_option,json=setOption,proto3,oneof" json:"set_option,omitempty"` } type Response_InitChain struct { - InitChain *ResponseInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof"` + InitChain *ResponseInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` } type Response_Query struct { - Query *ResponseQuery `protobuf:"bytes,7,opt,name=query,proto3,oneof"` + Query *ResponseQuery `protobuf:"bytes,7,opt,name=query,proto3,oneof" json:"query,omitempty"` } type Response_BeginBlock struct { - BeginBlock *ResponseBeginBlock `protobuf:"bytes,8,opt,name=begin_block,json=beginBlock,proto3,oneof"` + BeginBlock *ResponseBeginBlock `protobuf:"bytes,8,opt,name=begin_block,json=beginBlock,proto3,oneof" json:"begin_block,omitempty"` } type Response_CheckTx struct { - CheckTx *ResponseCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof"` + CheckTx *ResponseCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` } type Response_DeliverTx struct { - DeliverTx *ResponseDeliverTx `protobuf:"bytes,10,opt,name=deliver_tx,json=deliverTx,proto3,oneof"` + DeliverTx *ResponseDeliverTx `protobuf:"bytes,10,opt,name=deliver_tx,json=deliverTx,proto3,oneof" json:"deliver_tx,omitempty"` } type Response_EndBlock struct { - EndBlock *ResponseEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,proto3,oneof"` + EndBlock *ResponseEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,proto3,oneof" json:"end_block,omitempty"` } type Response_Commit struct { - Commit *ResponseCommit `protobuf:"bytes,12,opt,name=commit,proto3,oneof"` + Commit *ResponseCommit `protobuf:"bytes,12,opt,name=commit,proto3,oneof" json:"commit,omitempty"` } func (*Response_Exception) isResponse_Value() {} @@ -2185,11 +2185,11 @@ func (m *LastCommitInfo) GetVotes() []VoteInfo { } type Event struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Attributes []common.KVPair `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Attributes []kv.Pair `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Event) Reset() { *m = Event{} } @@ -2232,7 +2232,7 @@ func (m *Event) GetType() string { return "" } -func (m *Event) GetAttributes() []common.KVPair { +func (m *Event) GetAttributes() []kv.Pair { if m != nil { return m.Attributes } @@ -2952,152 +2952,152 @@ func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_9f1eaa func init() { golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_9f1eaa49c51fa1ac) } var fileDescriptor_9f1eaa49c51fa1ac = []byte{ - // 2317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x3d, 0x70, 0x1b, 0xc7, - 0x15, 0xe6, 0x01, 0x20, 0x80, 0x7b, 0xe0, 0x0f, 0xb4, 0x92, 0x6d, 0x18, 0x91, 0x49, 0xcd, 0xe9, - 0x8f, 0x72, 0x6c, 0xc8, 0x51, 0xc6, 0x19, 0x29, 0xd2, 0x38, 0x43, 0x50, 0x72, 0x80, 0x91, 0x6c, - 0xd3, 0x27, 0x89, 0x51, 0x7e, 0xc6, 0x37, 0x0b, 0xdc, 0x0a, 0xb8, 0x11, 0x70, 0x77, 0xbe, 0x5b, - 0x50, 0x44, 0x26, 0x7d, 0x26, 0x5d, 0x9a, 0x94, 0xe9, 0x53, 0xa6, 0x48, 0xe1, 0x32, 0xa5, 0x8b, - 0x14, 0x29, 0x52, 0x2b, 0x09, 0x93, 0x2a, 0xe3, 0x32, 0x93, 0x49, 0x99, 0xd9, 0xb7, 0x7b, 0x7f, - 0x20, 0x40, 0x9c, 0x1c, 0x75, 0x6e, 0xc8, 0xdb, 0xc5, 0x7b, 0x6f, 0x77, 0xdf, 0xbe, 0xf7, 0xbe, - 0xf7, 0xde, 0xc2, 0xeb, 0xb4, 0xd7, 0x77, 0xae, 0xf3, 0xa9, 0xcf, 0x42, 0xf9, 0xb7, 0xe5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0x19, 0x57, 0xa1, 0x96, 0xb2, 0x64, 0xd2, - 0x80, 0xca, 0x98, 0x85, 0x21, 0x1d, 0xb0, 0x86, 0x76, 0x41, 0xdb, 0xd1, 0xcd, 0x68, 0x68, 0x6c, - 0xc0, 0x5a, 0xda, 0x6e, 0x8d, 0x71, 0xcc, 0x28, 0x6c, 0x51, 0x30, 0x1e, 0xb2, 0x20, 0x14, 0x06, - 0xa8, 0x18, 0xd5, 0x90, 0x5c, 0x84, 0x75, 0x3c, 0xad, 0x15, 0xfd, 0x2e, 0xfc, 0xaa, 0x64, 0xae, - 0xe1, 0xe4, 0x81, 0x22, 0xda, 0x86, 0x9a, 0x7f, 0xc3, 0x8f, 0x49, 0x8a, 0x48, 0x02, 0xfe, 0x0d, - 0x5f, 0x11, 0x18, 0xdf, 0x87, 0xfa, 0xac, 0xe9, 0x92, 0x3a, 0x14, 0x9f, 0xb1, 0xa9, 0x5a, 0x4f, - 0x7c, 0x92, 0x73, 0xea, 0x58, 0xb8, 0x86, 0x6e, 0xaa, 0x33, 0xfe, 0xbe, 0x10, 0x33, 0xc7, 0xd6, - 0x2a, 0xdc, 0x4d, 0x04, 0x01, 0xe4, 0xae, 0xdd, 0x68, 0xb6, 0x64, 0x84, 0x68, 0x45, 0x11, 0xa2, - 0xf5, 0x28, 0x8a, 0x10, 0xed, 0xea, 0x97, 0x2f, 0xb6, 0x57, 0x7e, 0xfd, 0xd7, 0x6d, 0xcd, 0x44, - 0x0e, 0xf2, 0xa6, 0x30, 0x28, 0xea, 0xb8, 0x96, 0x63, 0xab, 0x75, 0x2a, 0x38, 0xee, 0xda, 0xe4, - 0x53, 0xa8, 0xf7, 0x3d, 0x37, 0x64, 0x6e, 0x38, 0x09, 0x2d, 0x9f, 0x06, 0x74, 0x1c, 0xaa, 0x58, - 0xb0, 0xe8, 0x92, 0xf7, 0x22, 0xf2, 0x7d, 0xa4, 0x36, 0x37, 0xfb, 0xd9, 0x09, 0xf2, 0x00, 0xe0, - 0x90, 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, 0x62, 0xf3, - 0xd5, 0x65, 0xa6, 0x36, 0x0f, 0x9c, 0x7f, 0x30, 0x03, 0xce, 0x97, 0x97, 0x9d, 0x6a, 0x21, 0x3a, - 0x5f, 0x13, 0xf1, 0x71, 0xc6, 0x33, 0x44, 0x2c, 0x65, 0x41, 0xe0, 0x05, 0x0a, 0xf8, 0xe4, 0xc0, - 0xd8, 0x11, 0x11, 0x3b, 0xb1, 0xff, 0x53, 0x90, 0x1c, 0x9d, 0x36, 0x65, 0xed, 0xc6, 0x17, 0x5a, - 0xc2, 0x8b, 0x91, 0x2d, 0x1d, 0xed, 0x75, 0x15, 0xed, 0x53, 0x00, 0x5f, 0xc8, 0x02, 0xfc, 0x36, - 0xd4, 0x04, 0xa6, 0xcc, 0x60, 0x37, 0xf5, 0x23, 0xec, 0x26, 0x6f, 0xc3, 0x19, 0x8c, 0xbf, 0x32, - 0x0d, 0x50, 0x81, 0xa4, 0x84, 0x81, 0x64, 0x53, 0xfc, 0x20, 0x35, 0x28, 0x81, 0xe2, 0x5d, 0x38, - 0x9b, 0xa2, 0x15, 0x72, 0x11, 0x0b, 0x24, 0x48, 0xd5, 0x63, 0xea, 0x5d, 0xdf, 0xef, 0xd0, 0x70, - 0x68, 0x7c, 0x94, 0x28, 0x28, 0xc9, 0x0b, 0x08, 0x94, 0xfa, 0x9e, 0x2d, 0xcf, 0xbd, 0x6e, 0xe2, - 0xb7, 0xc8, 0x15, 0x46, 0xde, 0x00, 0x37, 0xa7, 0x9b, 0xe2, 0x53, 0x50, 0xc5, 0xae, 0xad, 0x4b, - 0x9f, 0x35, 0xfe, 0xa0, 0x25, 0xf2, 0x92, 0x54, 0x61, 0x1e, 0xaa, 0x6b, 0xaf, 0x12, 0xd5, 0x0b, - 0xff, 0x1f, 0xaa, 0x1b, 0xff, 0xd6, 0x92, 0x2b, 0x8d, 0xf1, 0xfa, 0xeb, 0xa9, 0x40, 0x58, 0x97, - 0xe3, 0xda, 0xec, 0x08, 0x55, 0x5e,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0x4a, 0x6b, 0x82, - 0xde, 0x1a, 0x59, 0xe1, 0xcb, 0x39, 0x77, 0xfd, 0x30, 0x3b, 0x1d, 0x92, 0xcf, 0xe0, 0x8d, 0x99, - 0x18, 0x14, 0x2f, 0x50, 0x78, 0xa9, 0x50, 0xf4, 0x5a, 0x36, 0x14, 0x45, 0xf2, 0x13, 0xed, 0x15, - 0x5f, 0x89, 0xd7, 0x5c, 0x12, 0x29, 0x6c, 0x1a, 0xde, 0xe6, 0xd9, 0x84, 0xf1, 0x17, 0x0d, 0x36, - 0x67, 0x36, 0x48, 0x6e, 0xc2, 0xaa, 0x44, 0x60, 0xed, 0xd4, 0x46, 0x08, 0x6a, 0x5c, 0x9d, 0x49, - 0x32, 0x90, 0x5d, 0xa8, 0x32, 0x95, 0x5d, 0x2b, 0xa5, 0x5c, 0x5e, 0x92, 0x84, 0x2b, 0xfe, 0x98, - 0x8d, 0xdc, 0x05, 0x3d, 0x56, 0xfd, 0x92, 0xca, 0x2d, 0xbe, 0x39, 0x25, 0x24, 0x61, 0x34, 0xf6, - 0xa0, 0x96, 0xda, 0x1e, 0xf9, 0x16, 0xe8, 0x63, 0x7a, 0xa4, 0xca, 0x2d, 0x99, 0x40, 0x57, 0xc7, - 0xf4, 0x08, 0x2b, 0x2d, 0xf2, 0x06, 0x54, 0xc4, 0x8f, 0x03, 0x2a, 0x2f, 0xb2, 0x68, 0x96, 0xc7, - 0xf4, 0xe8, 0x87, 0x34, 0x34, 0xae, 0xc1, 0x46, 0x76, 0x9b, 0x11, 0x69, 0x04, 0xe9, 0x92, 0x74, - 0x77, 0xc0, 0x8c, 0xf7, 0x61, 0x73, 0x66, 0x37, 0xc4, 0x80, 0x75, 0x7f, 0xd2, 0xb3, 0x9e, 0xb1, - 0xa9, 0x85, 0xdb, 0x45, 0x33, 0xd4, 0xcd, 0x9a, 0x3f, 0xe9, 0xdd, 0x67, 0x53, 0x51, 0x11, 0x84, - 0x46, 0x1f, 0x36, 0xb2, 0x85, 0x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zipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4d, 0x90, 0x1b, 0x47, + 0x15, 0xde, 0x91, 0xb4, 0x92, 0xe6, 0x69, 0x7f, 0xe4, 0xb6, 0x93, 0x28, 0xc2, 0xd9, 0x75, 0x8d, + 0xff, 0xd6, 0x21, 0x91, 0xc3, 0x42, 0xa8, 0x18, 0xbb, 0x42, 0xad, 0xd6, 0x0e, 0x52, 0xc5, 0x49, + 0x36, 0x63, 0x7b, 0x31, 0x50, 0x95, 0xa9, 0x96, 0xa6, 0x2d, 0x4d, 0xad, 0x34, 0x33, 0x99, 0x69, + 0xc9, 0xbb, 0x14, 0x77, 0x8a, 0x1b, 0x17, 0x8e, 0xdc, 0x39, 0x72, 0xe0, 0x90, 0x23, 0xc7, 0x1c, + 0x38, 0x70, 0xe0, 0x6c, 0x60, 0xe1, 0x44, 0xe5, 0x48, 0x51, 0x1c, 0xa9, 0x7e, 0xdd, 0xf3, 0x27, + 0x4b, 0xab, 0x71, 0xf0, 0x2d, 0x97, 0xdd, 0xe9, 0xd6, 0x7b, 0xaf, 0xbb, 0x5f, 0xbf, 0xf7, 0xbe, + 0xf7, 0x5e, 0xc3, 0xab, 0xb4, 0xd7, 0x77, 0x6e, 0xf2, 0x13, 0x9f, 0x85, 0xf2, 0x6f, 0xcb, 0x0f, + 0x3c, 0xee, 0x91, 0x57, 0x38, 0x73, 0x6d, 0x16, 0x8c, 0x1d, 0x97, 0xb7, 0x04, 0x49, 0x0b, 0x7f, + 0x6c, 0xbe, 0x3d, 0x70, 0xf8, 0x70, 0xd2, 0x6b, 0xf5, 0xbd, 0xf1, 0xcd, 0x81, 0x37, 0xf0, 0x6e, + 0x22, 0x75, 0x6f, 0xf2, 0x04, 0x47, 0x38, 0xc0, 0x2f, 0x29, 0xa5, 0x79, 0x3b, 0x45, 0x9e, 0x08, + 0x4c, 0x7f, 0xf6, 0x83, 0x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20, 0x0f, 0xf9, 0x10, 0x6a, 0x3d, 0x36, + 0x70, 0x5c, 0xab, 0x37, 0xf2, 0xfa, 0x47, 0x8d, 0x2a, 0x8a, 0xd8, 0x39, 0x5b, 0x44, 0x5b, 0x30, + 0xb4, 0x05, 0x7d, 0x67, 0xc5, 0x84, 0x5e, 0x3c, 0x22, 0x6d, 0xa8, 0xf6, 0x87, 0xac, 0x7f, 0x64, + 0xf1, 0xe3, 0x86, 0x8e, 0x92, 0xae, 0x9e, 0x2d, 0x69, 0x5f, 0x50, 0x3f, 0x3c, 0xee, 0xac, 0x98, + 0x95, 0xbe, 0xfc, 0x14, 0x7a, 0xb1, 0xd9, 0xc8, 0x99, 0xb2, 0x40, 0x48, 0x39, 0x9f, 0x47, 0x2f, + 0x77, 0x25, 0x3d, 0xca, 0xd1, 0xed, 0x68, 0x40, 0xee, 0x81, 0xce, 0x5c, 0x5b, 0x1d, 0xac, 0x86, + 0x82, 0xae, 0x2d, 0xb1, 0x30, 0xd7, 0x8e, 0x8e, 0x55, 0x65, 0xea, 0x9b, 0xbc, 0x0f, 0xe5, 0xbe, + 0x37, 0x1e, 0x3b, 0xbc, 0xb1, 0x86, 0x32, 0xae, 0x2c, 0x39, 0x12, 0xd2, 0x76, 0x56, 0x4c, 0xc5, + 0xd5, 0xae, 0xc0, 0xea, 0x94, 0x8e, 0x26, 0xcc, 0xb8, 0x0e, 0xb5, 0x94, 0x25, 0x93, 0x06, 0x54, + 0xc6, 0x2c, 0x0c, 0xe9, 0x80, 0x35, 0xb4, 0x4b, 0xda, 0x8e, 0x6e, 0x46, 0x43, 0x63, 0x03, 0xd6, + 0xd2, 0x76, 0x6b, 0x8c, 0x63, 0x46, 0x61, 0x8b, 0x82, 0x71, 0xca, 0x82, 0x50, 0x18, 0xa0, 0x62, + 0x54, 0x43, 0x72, 0x19, 0xd6, 0xf1, 0xb4, 0x56, 0xf4, 0xbb, 0xf0, 0xab, 0x92, 0xb9, 0x86, 0x93, + 0x87, 0x8a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 0xce, 0x23, 0xed, 0x65, 0x58, 0x8f, 0x3c, 0x5e, 0xd2, 0xad, 0x23, 0xdd, + 0x5a, 0x34, 0x89, 0x44, 0x37, 0xa0, 0xee, 0x07, 0x9e, 0xef, 0x85, 0x2c, 0xb0, 0xa8, 0x6d, 0x07, + 0x2c, 0x0c, 0x1b, 0x1b, 0x52, 0x5e, 0x34, 0xbf, 0x27, 0xa7, 0x8d, 0xef, 0x40, 0x25, 0xca, 0x75, + 0x2f, 0xc0, 0x6a, 0x3b, 0x8e, 0x5e, 0x25, 0x53, 0x0e, 0x04, 0xf6, 0xed, 0xf9, 0xbe, 0xea, 0x7c, + 0x89, 0x4f, 0x63, 0x04, 0x15, 0x75, 0x61, 0x73, 0xfb, 0x1d, 0x1f, 0xc1, 0x9a, 0x4f, 0x03, 0x71, + 0x8c, 0x74, 0xd7, 0x63, 0x51, 0xb5, 0x76, 0x40, 0x03, 0xfe, 0x80, 0xf1, 0x4c, 0xf3, 0xa3, 0x86, + 0xfc, 0x72, 0xca, 0xb8, 0x05, 0xeb, 0x19, 0x1a, 0xb1, 0x4d, 0xee, 0x71, 0x3a, 0x8a, 0x1c, 0x1d, + 0x07, 0xf1, 0x4e, 0x0a, 0xc9, 0x4e, 0x8c, 0xdb, 0xa0, 0xc7, 0x77, 0x25, 0x8a, 0x80, 0x48, 0x15, + 0x9a, 0x52, 0xbf, 0x1c, 0x62, 0x83, 0xc7, 0x7b, 0xca, 0x02, 0x65, 0xfd, 0x72, 0x60, 0xb0, 0x54, + 0x60, 0x92, 0x48, 0x43, 0xee, 0x40, 0x45, 0x05, 0x26, 0xe5, 0x8f, 0x8b, 0x5a, 0x39, 0x07, 0x18, + 0xa9, 0xa2, 0x56, 0x8e, 0x8c, 0x5b, 0xc9, 0x32, 0x85, 0xf4, 0x32, 0xbf, 0x80, 0x6a, 0x14, 0x7c, + 0xb2, 0x11, 0x5c, 0xae, 0x70, 0x69, 0x59, 0x04, 0x57, 0x8b, 0x24, 0x8c, 0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 0xf5, 0xc9, 0xb2, 0x36, 0xcf, 0x33, 0x52, 0x33, 0x57, 0x4f, 0x8b, 0x3c, 0x82, 0xb2, + 0x4a, 0x4c, 0x73, 0xbd, 0x9d, 0x34, 0xf3, 0x35, 0x71, 0x84, 0x92, 0x93, 0xc6, 0x41, 0xde, 0xa7, + 0xb3, 0x66, 0xee, 0x66, 0x1e, 0xa1, 0x00, 0xa9, 0x5a, 0x37, 0xf7, 0x9b, 0x58, 0x33, 0x7f, 0x93, + 0x8e, 0xfc, 0x0c, 0xaa, 0x71, 0x45, 0x93, 0xf3, 0x6d, 0xaa, 0x99, 0xb7, 0x4f, 0xd6, 0xee, 0xfe, + 0xf7, 0xef, 0x5b, 0xda, 0xef, 0x4e, 0xb7, 0xb4, 0x2f, 0x4e, 0xb7, 0xb4, 0x2f, 0x4f, 0xb7, 0xb4, + 0x3f, 0x9f, 0x6e, 0x69, 0x7f, 0x3b, 0xdd, 0xd2, 0xfe, 0xf8, 0x8f, 0x2d, 0xed, 0xa7, 0xdf, 0x5e, + 0xfa, 0xba, 0x9b, 0xbc, 0x4c, 0xf7, 0xca, 0x18, 0xb0, 0xbe, 0xfb, 0xbf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x83, 0x66, 0x2e, 0x0b, 0xae, 0x1e, 0x00, 0x00, } func (this *Request) Equal(that interface{}) bool { @@ -5490,7 +5490,8 @@ func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { } func (m *Request_Echo) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5510,7 +5511,8 @@ func (m *Request_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_Flush) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5530,7 +5532,8 @@ func (m *Request_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_Info) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5550,7 +5553,8 @@ func (m *Request_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_SetOption) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_SetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5570,7 +5574,8 @@ func (m *Request_SetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_InitChain) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5590,7 +5595,8 @@ func (m *Request_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_Query) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5610,7 +5616,8 @@ func (m *Request_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_BeginBlock) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_BeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5630,7 +5637,8 @@ func (m *Request_BeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_CheckTx) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5650,7 +5658,8 @@ func (m *Request_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_EndBlock) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_EndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5670,7 +5679,8 @@ func (m *Request_EndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_Commit) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -5690,7 +5700,8 @@ func (m *Request_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Request_DeliverTx) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Request_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6225,7 +6236,8 @@ func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { } func (m *Response_Exception) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_Exception) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6245,7 +6257,8 @@ func (m *Response_Exception) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_Echo) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6265,7 +6278,8 @@ func (m *Response_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_Flush) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6285,7 +6299,8 @@ func (m *Response_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_Info) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6305,7 +6320,8 @@ func (m *Response_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_SetOption) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_SetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6325,7 +6341,8 @@ func (m *Response_SetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_InitChain) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6345,7 +6362,8 @@ func (m *Response_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_Query) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6365,7 +6383,8 @@ func (m *Response_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_BeginBlock) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_BeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6385,7 +6404,8 @@ func (m *Response_BeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_CheckTx) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6405,7 +6425,8 @@ func (m *Response_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_DeliverTx) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6425,7 +6446,8 @@ func (m *Response_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_EndBlock) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_EndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -6445,7 +6467,8 @@ func (m *Response_EndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } func (m *Response_Commit) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Response_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -8522,9 +8545,9 @@ func NewPopulatedEvent(r randyTypes, easy bool) *Event { this.Type = string(randStringTypes(r)) if r.Intn(5) != 0 { v34 := r.Intn(5) - this.Attributes = make([]common.KVPair, v34) + this.Attributes = make([]kv.Pair, v34) for i := 0; i < v34; i++ { - v35 := common.NewPopulatedKVPair(r, easy) + v35 := kv.NewPopulatedPair(r, easy) this.Attributes[i] = *v35 } } @@ -14631,7 +14654,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Attributes = append(m.Attributes, common.KVPair{}) + m.Attributes = append(m.Attributes, kv.Pair{}) if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -16124,6 +16147,7 @@ func (m *Evidence) Unmarshal(dAtA []byte) error { func skipTypes(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 { @@ -16155,10 +16179,8 @@ func skipTypes(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -16179,55 +16201,30 @@ func skipTypes(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthTypes } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipTypes(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") ) diff --git a/abci/types/types.proto b/abci/types/types.proto index d9986b1df..146e25e65 100644 --- a/abci/types/types.proto +++ b/abci/types/types.proto @@ -6,7 +6,7 @@ option go_package = "github.com/tendermint/tendermint/abci/types"; // https://github.com/gogo/protobuf/blob/master/extensions.md import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/tendermint/tendermint/crypto/merkle/merkle.proto"; -import "github.com/tendermint/tendermint/libs/common/types.proto"; +import "github.com/tendermint/tendermint/libs/kv/types.proto"; import "google/protobuf/timestamp.proto"; // This file is copied from http://github.com/tendermint/abci @@ -245,7 +245,7 @@ message LastCommitInfo { message Event { string type = 1; - repeated tendermint.libs.common.KVPair attributes = 2 [(gogoproto.nullable)=false, (gogoproto.jsontag)="attributes,omitempty"]; + repeated tendermint.libs.kv.Pair attributes = 2 [(gogoproto.nullable)=false, (gogoproto.jsontag)="attributes,omitempty"]; } //---------------------------------------- diff --git a/abci/types/typespb_test.go b/abci/types/typespb_test.go index e900d3841..8c9e4120c 100644 --- a/abci/types/typespb_test.go +++ b/abci/types/typespb_test.go @@ -12,7 +12,7 @@ import ( golang_proto "github.com/golang/protobuf/proto" _ "github.com/golang/protobuf/ptypes/timestamp" _ "github.com/tendermint/tendermint/crypto/merkle" - _ "github.com/tendermint/tendermint/libs/common" + _ "github.com/tendermint/tendermint/libs/kv" math "math" math_rand "math/rand" testing "testing" diff --git a/crypto/merkle/simple_map.go b/crypto/merkle/simple_map.go index bde442203..36434f67f 100644 --- a/crypto/merkle/simple_map.go +++ b/crypto/merkle/simple_map.go @@ -5,14 +5,14 @@ import ( amino "github.com/tendermint/go-amino" "github.com/tendermint/tendermint/crypto/tmhash" - cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/libs/kv" ) // Merkle tree from a map. // Leaves are `hash(key) | hash(value)`. // Leaves are sorted before Merkle hashing. type simpleMap struct { - kvs cmn.KVPairs + kvs kv.Pairs sorted bool } @@ -33,7 +33,7 @@ func (sm *simpleMap) Set(key string, value []byte) { // and make a determination to fetch or not. vhash := tmhash.Sum(value) - sm.kvs = append(sm.kvs, cmn.KVPair{ + sm.kvs = append(sm.kvs, kv.Pair{ Key: []byte(key), Value: vhash, }) @@ -56,9 +56,9 @@ func (sm *simpleMap) Sort() { // Returns a copy of sorted KVPairs. // NOTE these contain the hashed key and value. -func (sm *simpleMap) KVPairs() cmn.KVPairs { +func (sm *simpleMap) KVPairs() kv.Pairs { sm.Sort() - kvs := make(cmn.KVPairs, len(sm.kvs)) + kvs := make(kv.Pairs, len(sm.kvs)) copy(kvs, sm.kvs) return kvs } @@ -68,7 +68,7 @@ func (sm *simpleMap) KVPairs() cmn.KVPairs { // A local extension to KVPair that can be hashed. // Key and value are length prefixed and concatenated, // then hashed. -type KVPair cmn.KVPair +type KVPair kv.Pair // Bytes returns key || value, with both the // key and value length prefixed. @@ -85,7 +85,7 @@ func (kv KVPair) Bytes() []byte { return b.Bytes() } -func hashKVPairs(kvs cmn.KVPairs) []byte { +func hashKVPairs(kvs kv.Pairs) []byte { kvsH := make([][]byte, len(kvs)) for i, kvp := range kvs { kvsH[i] = KVPair(kvp).Bytes() diff --git a/docs/app-dev/app-development.md b/docs/app-dev/app-development.md index 74c2eafad..44a2ea623 100644 --- a/docs/app-dev/app-development.md +++ b/docs/app-dev/app-development.md @@ -187,7 +187,7 @@ func (app *KVStoreApplication) DeliverTx(req types.RequestDeliverTx) types.Respo events := []types.Event{ { Type: "app", - Attributes: []cmn.KVPair{ + Attributes: []kv.Pair{ {Key: []byte("creator"), Value: []byte("Cosmoshi Netowoko")}, {Key: []byte("key"), Value: key}, }, diff --git a/docs/app-dev/indexing-transactions.md b/docs/app-dev/indexing-transactions.md index 31ff737e1..b3a4789b0 100644 --- a/docs/app-dev/indexing-transactions.md +++ b/docs/app-dev/indexing-transactions.md @@ -76,10 +76,10 @@ func (app *KVStoreApplication) DeliverTx(req types.RequestDeliverTx) types.Resul events := []abci.Event{ { Type: "transfer", - Attributes: cmn.KVPairs{ - cmn.KVPair{Key: []byte("sender"), Value: []byte("Bob")}, - cmn.KVPair{Key: []byte("recipient"), Value: []byte("Alice")}, - cmn.KVPair{Key: []byte("balance"), Value: []byte("100")}, + Attributes: kv.Pairs{ + kv.Pair{Key: []byte("sender"), Value: []byte("Bob")}, + kv.Pair{Key: []byte("recipient"), Value: []byte("Alice")}, + kv.Pair{Key: []byte("balance"), Value: []byte("100")}, }, }, } diff --git a/docs/architecture/adr-037-deliver-block.md b/docs/architecture/adr-037-deliver-block.md index 31907c9ae..c5e119c06 100644 --- a/docs/architecture/adr-037-deliver-block.md +++ b/docs/architecture/adr-037-deliver-block.md @@ -70,7 +70,7 @@ type RequestDeliverBlock struct { type ResponseDeliverBlock struct { ValidatorUpdates []ValidatorUpdate ConsensusParamUpdates *ConsensusParams - Tags []common.KVPair + Tags []kv.Pair TxResults []ResponseDeliverTx } diff --git a/libs/common/int_test.go b/libs/common/int_test.go deleted file mode 100644 index 1ecc7844c..000000000 --- a/libs/common/int_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package common - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestIntInSlice(t *testing.T) { - assert.True(t, IntInSlice(1, []int{1, 2, 3})) - assert.False(t, IntInSlice(4, []int{1, 2, 3})) - assert.True(t, IntInSlice(0, []int{0})) - assert.False(t, IntInSlice(0, []int{})) -} diff --git a/libs/common/kvpair.go b/libs/kv/kvpair.go similarity index 78% rename from libs/common/kvpair.go rename to libs/kv/kvpair.go index 54c3a58c0..3007c0272 100644 --- a/libs/common/kvpair.go +++ b/libs/kv/kvpair.go @@ -1,4 +1,4 @@ -package common +package kv import ( "bytes" @@ -11,17 +11,17 @@ import ( /* Defined in types.proto -type KVPair struct { +type Pair struct { Key []byte Value []byte } */ -type KVPairs []KVPair +type Pairs []Pair // Sorting -func (kvs KVPairs) Len() int { return len(kvs) } -func (kvs KVPairs) Less(i, j int) bool { +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 @@ -33,8 +33,8 @@ func (kvs KVPairs) Less(i, j int) bool { panic("invalid comparison result") } } -func (kvs KVPairs) Swap(i, j int) { kvs[i], kvs[j] = kvs[j], kvs[i] } -func (kvs KVPairs) Sort() { sort.Sort(kvs) } +func (kvs Pairs) Swap(i, j int) { kvs[i], kvs[j] = kvs[j], kvs[i] } +func (kvs Pairs) Sort() { sort.Sort(kvs) } //---------------------------------------- // KI64Pair diff --git a/libs/common/result.go b/libs/kv/result.go similarity index 88% rename from libs/common/result.go rename to libs/kv/result.go index 90d149f4b..b2d855cbc 100644 --- a/libs/common/result.go +++ b/libs/kv/result.go @@ -1,6 +1,6 @@ // nolint: dupl // dupl is reading this as the same file as crypto/merkle/result.go -package common +package kv import ( "bytes" @@ -20,12 +20,12 @@ var ( jsonpbUnmarshaller = jsonpb.Unmarshaler{} ) -func (r *KVPair) MarshalJSON() ([]byte, error) { +func (r *Pair) MarshalJSON() ([]byte, error) { s, err := jsonpbMarshaller.MarshalToString(r) return []byte(s), err } -func (r *KVPair) UnmarshalJSON(b []byte) error { +func (r *Pair) UnmarshalJSON(b []byte) error { reader := bytes.NewBuffer(b) return jsonpbUnmarshaller.Unmarshal(reader, r) } @@ -50,5 +50,5 @@ type jsonRoundTripper interface { json.Unmarshaler } -var _ jsonRoundTripper = (*KVPair)(nil) +var _ jsonRoundTripper = (*Pair)(nil) var _ jsonRoundTripper = (*KI64Pair)(nil) diff --git a/libs/common/types.pb.go b/libs/kv/types.pb.go similarity index 78% rename from libs/common/types.pb.go rename to libs/kv/types.pb.go index 149f14556..6354c77a5 100644 --- a/libs/common/types.pb.go +++ b/libs/kv/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: libs/common/types.proto +// source: libs/kv/types.proto -package common +package kv import ( bytes "bytes" @@ -27,7 +27,7 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Define these here for compatibility but use tmlibs/common.KVPair. -type KVPair struct { +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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -35,18 +35,18 @@ type KVPair struct { XXX_sizecache int32 `json:"-"` } -func (m *KVPair) Reset() { *m = KVPair{} } -func (m *KVPair) String() string { return proto.CompactTextString(m) } -func (*KVPair) ProtoMessage() {} -func (*KVPair) Descriptor() ([]byte, []int) { - return fileDescriptor_28b36ea5054b507d, []int{0} +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_31432671d164f444, []int{0} } -func (m *KVPair) XXX_Unmarshal(b []byte) error { +func (m *Pair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *KVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_KVPair.Marshal(b, m, deterministic) + return xxx_messageInfo_Pair.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -56,26 +56,26 @@ func (m *KVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *KVPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVPair.Merge(m, src) +func (m *Pair) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pair.Merge(m, src) } -func (m *KVPair) XXX_Size() int { +func (m *Pair) XXX_Size() int { return m.Size() } -func (m *KVPair) XXX_DiscardUnknown() { - xxx_messageInfo_KVPair.DiscardUnknown(m) +func (m *Pair) XXX_DiscardUnknown() { + xxx_messageInfo_Pair.DiscardUnknown(m) } -var xxx_messageInfo_KVPair proto.InternalMessageInfo +var xxx_messageInfo_Pair proto.InternalMessageInfo -func (m *KVPair) GetKey() []byte { +func (m *Pair) GetKey() []byte { if m != nil { return m.Key } return nil } -func (m *KVPair) GetValue() []byte { +func (m *Pair) GetValue() []byte { if m != nil { return m.Value } @@ -95,7 +95,7 @@ func (m *KI64Pair) Reset() { *m = KI64Pair{} } func (m *KI64Pair) String() string { return proto.CompactTextString(m) } func (*KI64Pair) ProtoMessage() {} func (*KI64Pair) Descriptor() ([]byte, []int) { - return fileDescriptor_28b36ea5054b507d, []int{1} + return fileDescriptor_31432671d164f444, []int{1} } func (m *KI64Pair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -139,40 +139,40 @@ func (m *KI64Pair) GetValue() int64 { } func init() { - proto.RegisterType((*KVPair)(nil), "tendermint.libs.common.KVPair") - golang_proto.RegisterType((*KVPair)(nil), "tendermint.libs.common.KVPair") - proto.RegisterType((*KI64Pair)(nil), "tendermint.libs.common.KI64Pair") - golang_proto.RegisterType((*KI64Pair)(nil), "tendermint.libs.common.KI64Pair") -} - -func init() { proto.RegisterFile("libs/common/types.proto", fileDescriptor_28b36ea5054b507d) } -func init() { golang_proto.RegisterFile("libs/common/types.proto", fileDescriptor_28b36ea5054b507d) } - -var fileDescriptor_28b36ea5054b507d = []byte{ - // 197 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0xc9, 0x4c, 0x2a, - 0xd6, 0x4f, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x2b, 0x49, 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, - 0x03, 0xa9, 0xd1, 0x83, 0xa8, 0x91, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0x02, 0x71, 0xf5, - 0xd3, 0xf3, 0xd3, 0xf3, 0xf5, 0xc1, 0xca, 0x93, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, - 0x18, 0xa3, 0x64, 0xc0, 0xc5, 0xe6, 0x1d, 0x16, 0x90, 0x98, 0x59, 0x24, 0x24, 0xc0, 0xc5, 0x9c, - 0x9d, 0x5a, 0x29, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0x62, 0x0a, 0x89, 0x70, 0xb1, 0x96, - 0x25, 0xe6, 0x94, 0xa6, 0x4a, 0x30, 0x81, 0xc5, 0x20, 0x1c, 0x25, 0x23, 0x2e, 0x0e, 0x6f, 0x4f, - 0x33, 0x13, 0x62, 0xf4, 0x30, 0x43, 0xf5, 0x38, 0x79, 0xfd, 0x78, 0x28, 0xc7, 0xb8, 0xe2, 0x91, - 0x1c, 0xe3, 0x8e, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, - 0x91, 0x1c, 0xe3, 0x81, 0xc7, 0x72, 0x8c, 0x51, 0x3a, 0x48, 0x4e, 0x46, 0xf8, 0x0a, 0x99, 0x89, - 0x14, 0x08, 0x49, 0x6c, 0x60, 0x87, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd4, 0xc3, 0x96, - 0x94, 0x1a, 0x01, 0x00, 0x00, -} - -func (this *KVPair) Equal(that interface{}) bool { + proto.RegisterType((*Pair)(nil), "tendermint.libs.kv.Pair") + golang_proto.RegisterType((*Pair)(nil), "tendermint.libs.kv.Pair") + proto.RegisterType((*KI64Pair)(nil), "tendermint.libs.kv.KI64Pair") + golang_proto.RegisterType((*KI64Pair)(nil), "tendermint.libs.kv.KI64Pair") +} + +func init() { proto.RegisterFile("libs/kv/types.proto", fileDescriptor_31432671d164f444) } +func init() { golang_proto.RegisterFile("libs/kv/types.proto", fileDescriptor_31432671d164f444) } + +var fileDescriptor_31432671d164f444 = []byte{ + // 193 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xc9, 0x4c, 0x2a, + 0xd6, 0xcf, 0x2e, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x2a, 0x49, 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x03, 0xc9, 0xeb, 0x65, + 0x97, 0x49, 0xe9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, + 0xa7, 0xe7, 0xeb, 0x83, 0x95, 0x26, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0x31, 0x42, + 0x49, 0x8f, 0x8b, 0x25, 0x20, 0x31, 0xb3, 0x48, 0x48, 0x80, 0x8b, 0x39, 0x3b, 0xb5, 0x52, 0x82, + 0x51, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc4, 0x14, 0x12, 0xe1, 0x62, 0x2d, 0x4b, 0xcc, 0x29, 0x4d, + 0x95, 0x60, 0x02, 0x8b, 0x41, 0x38, 0x4a, 0x46, 0x5c, 0x1c, 0xde, 0x9e, 0x66, 0x26, 0xc4, 0xe8, + 0x61, 0x86, 0xea, 0x71, 0x72, 0xfb, 0xf1, 0x50, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x1d, 0x8f, + 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x03, + 0x8f, 0xe5, 0x18, 0xa3, 0x34, 0x90, 0x1c, 0x8c, 0xf0, 0x0f, 0x32, 0x13, 0xea, 0xf5, 0x24, 0x36, + 0xb0, 0x93, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x01, 0x3f, 0x5a, 0xca, 0x0c, 0x01, 0x00, + 0x00, +} + +func (this *Pair) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*KVPair) + that1, ok := that.(*Pair) if !ok { - that2, ok := that.(KVPair) + that2, ok := that.(Pair) if ok { that1 = &that2 } else { @@ -225,7 +225,7 @@ func (this *KI64Pair) Equal(that interface{}) bool { } return true } -func (m *KVPair) Marshal() (dAtA []byte, err error) { +func (m *Pair) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -235,12 +235,12 @@ func (m *KVPair) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *KVPair) MarshalTo(dAtA []byte) (int, error) { +func (m *Pair) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *KVPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -316,8 +316,8 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func NewPopulatedKVPair(r randyTypes, easy bool) *KVPair { - this := &KVPair{} +func NewPopulatedPair(r randyTypes, easy bool) *Pair { + this := &Pair{} v1 := r.Intn(100) this.Key = make([]byte, v1) for i := 0; i < v1; i++ { @@ -423,7 +423,7 @@ func encodeVarintPopulateTypes(dAtA []byte, v uint64) []byte { dAtA = append(dAtA, uint8(v)) return dAtA } -func (m *KVPair) Size() (n int) { +func (m *Pair) Size() (n int) { if m == nil { return 0 } @@ -468,7 +468,7 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *KVPair) Unmarshal(dAtA []byte) error { +func (m *Pair) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -491,10 +491,10 @@ func (m *KVPair) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KVPair: wiretype end group for non-group") + return fmt.Errorf("proto: Pair: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KVPair: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -700,6 +700,7 @@ func (m *KI64Pair) Unmarshal(dAtA []byte) error { func skipTypes(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 { @@ -731,10 +732,8 @@ func skipTypes(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -755,55 +754,30 @@ func skipTypes(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthTypes } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipTypes(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") ) diff --git a/libs/common/types.proto b/libs/kv/types.proto similarity index 85% rename from libs/common/types.proto rename to libs/kv/types.proto index 7a43c277b..59940c8d0 100644 --- a/libs/common/types.proto +++ b/libs/kv/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package tendermint.libs.common; -option go_package = "github.com/tendermint/tendermint/libs/common"; +package tendermint.libs.kv; +option go_package = "github.com/tendermint/tendermint/libs/kv"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -17,7 +17,7 @@ option (gogoproto.testgen_all) = true; // Abstract types // Define these here for compatibility but use tmlibs/common.KVPair. -message KVPair { +message Pair { bytes key = 1; bytes value = 2; } diff --git a/libs/common/typespb_test.go b/libs/kv/typespb_test.go similarity index 92% rename from libs/common/typespb_test.go rename to libs/kv/typespb_test.go index a4b96a389..38656ecf9 100644 --- a/libs/common/typespb_test.go +++ b/libs/kv/typespb_test.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: libs/common/types.proto +// source: libs/kv/types.proto -package common +package kv import ( fmt "fmt" @@ -22,15 +22,15 @@ var _ = golang_proto.Marshal var _ = fmt.Errorf var _ = math.Inf -func TestKVPairProto(t *testing.T) { +func TestPairProto(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedKVPair(popr, false) + p := NewPopulatedPair(popr, false) dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &KVPair{} + msg := &Pair{} if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -53,10 +53,10 @@ func TestKVPairProto(t *testing.T) { } } -func TestKVPairMarshalTo(t *testing.T) { +func TestPairMarshalTo(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedKVPair(popr, false) + p := NewPopulatedPair(popr, false) size := p.Size() dAtA := make([]byte, size) for i := range dAtA { @@ -66,7 +66,7 @@ func TestKVPairMarshalTo(t *testing.T) { if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &KVPair{} + msg := &Pair{} if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -134,16 +134,16 @@ func TestKI64PairMarshalTo(t *testing.T) { } } -func TestKVPairJSON(t *testing.T) { +func TestPairJSON(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedKVPair(popr, true) + p := NewPopulatedPair(popr, true) marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &KVPair{} + msg := &Pair{} err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) @@ -170,12 +170,12 @@ func TestKI64PairJSON(t *testing.T) { t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestKVPairProtoText(t *testing.T) { +func TestPairProtoText(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedKVPair(popr, true) + p := NewPopulatedPair(popr, true) dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &KVPair{} + msg := &Pair{} if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -184,12 +184,12 @@ func TestKVPairProtoText(t *testing.T) { } } -func TestKVPairProtoCompactText(t *testing.T) { +func TestPairProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedKVPair(popr, true) + p := NewPopulatedPair(popr, true) dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &KVPair{} + msg := &Pair{} if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -226,10 +226,10 @@ func TestKI64PairProtoCompactText(t *testing.T) { } } -func TestKVPairSize(t *testing.T) { +func TestPairSize(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedKVPair(popr, true) + p := NewPopulatedPair(popr, true) size2 := github_com_gogo_protobuf_proto.Size(p) dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { diff --git a/rpc/swagger/swagger.yaml b/rpc/swagger/swagger.yaml index d6e66dbe5..f2a40250a 100644 --- a/rpc/swagger/swagger.yaml +++ b/rpc/swagger/swagger.yaml @@ -187,28 +187,28 @@ paths: Events: []abci.Event{ { Type: "rewards.withdraw", - Attributes: cmn.KVPairs{ - cmn.KVPair{Key: []byte("address"), Value: []byte("AddrA")}, - cmn.KVPair{Key: []byte("source"), Value: []byte("SrcX")}, - cmn.KVPair{Key: []byte("amount"), Value: []byte("...")}, - cmn.KVPair{Key: []byte("balance"), Value: []byte("...")}, + Attributes: kv.Pairs{ + kv.Pair{Key: []byte("address"), Value: []byte("AddrA")}, + kv.Pair{Key: []byte("source"), Value: []byte("SrcX")}, + kv.Pair{Key: []byte("amount"), Value: []byte("...")}, + kv.Pair{Key: []byte("balance"), Value: []byte("...")}, }, }, { Type: "rewards.withdraw", - Attributes: cmn.KVPairs{ - cmn.KVPair{Key: []byte("address"), Value: []byte("AddrB")}, - cmn.KVPair{Key: []byte("source"), Value: []byte("SrcY")}, - cmn.KVPair{Key: []byte("amount"), Value: []byte("...")}, - cmn.KVPair{Key: []byte("balance"), Value: []byte("...")}, + Attributes: kv.Pairs{ + kv.Pair{Key: []byte("address"), Value: []byte("AddrB")}, + kv.Pair{Key: []byte("source"), Value: []byte("SrcY")}, + kv.Pair{Key: []byte("amount"), Value: []byte("...")}, + kv.Pair{Key: []byte("balance"), Value: []byte("...")}, }, }, { Type: "transfer", - Attributes: cmn.KVPairs{ - cmn.KVPair{Key: []byte("sender"), Value: []byte("AddrC")}, - cmn.KVPair{Key: []byte("recipient"), Value: []byte("AddrD")}, - cmn.KVPair{Key: []byte("amount"), Value: []byte("...")}, + Attributes: kv.Pairs{ + kv.Pair{Key: []byte("sender"), Value: []byte("AddrC")}, + kv.Pair{Key: []byte("recipient"), Value: []byte("AddrD")}, + kv.Pair{Key: []byte("amount"), Value: []byte("...")}, }, }, }, diff --git a/state/state_test.go b/state/state_test.go index 0d9cd07a0..a407f49ad 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -13,6 +13,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/ed25519" cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/libs/kv" sm "github.com/tendermint/tendermint/state" dbm "github.com/tendermint/tm-db" @@ -132,8 +133,8 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { { Data: []byte("Gotcha!"), Events: []abci.Event{ - {Type: "type1", Attributes: []cmn.KVPair{{Key: []byte("a"), Value: []byte("1")}}}, - {Type: "type2", Attributes: []cmn.KVPair{{Key: []byte("build"), Value: []byte("stuff")}}}, + {Type: "type1", Attributes: []kv.Pair{{Key: []byte("a"), Value: []byte("1")}}}, + {Type: "type2", Attributes: []kv.Pair{{Key: []byte("build"), Value: []byte("stuff")}}}, }, }, }, diff --git a/state/txindex/kv/kv.go b/state/txindex/kv/kv.go index 0a56df22d..46365dafb 100644 --- a/state/txindex/kv/kv.go +++ b/state/txindex/kv/kv.go @@ -220,7 +220,7 @@ func (txi *TxIndex) Search(q *query.Query) ([]*types.TxResult, error) { // for all other conditions for i, c := range conditions { - if cmn.IntInSlice(i, skipIndexes) { + if intInSlice(i, skipIndexes) { continue } diff --git a/state/txindex/kv/kv_bench_test.go b/state/txindex/kv/kv_bench_test.go index 834cf52e7..3e3bdced3 100644 --- a/state/txindex/kv/kv_bench_test.go +++ b/state/txindex/kv/kv_bench_test.go @@ -7,7 +7,7 @@ import ( "testing" abci "github.com/tendermint/tendermint/abci/types" - cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/libs/kv" "github.com/tendermint/tendermint/libs/pubsub/query" "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -31,7 +31,7 @@ func BenchmarkTxSearch(b *testing.B) { events := []abci.Event{ { Type: "transfer", - Attributes: []cmn.KVPair{ + Attributes: []kv.Pair{ {Key: []byte("address"), Value: []byte(fmt.Sprintf("address_%d", i%100))}, {Key: []byte("amount"), Value: []byte("50")}, }, diff --git a/state/txindex/kv/kv_test.go b/state/txindex/kv/kv_test.go index 4da251062..ecdac7260 100644 --- a/state/txindex/kv/kv_test.go +++ b/state/txindex/kv/kv_test.go @@ -13,6 +13,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/libs/kv" "github.com/tendermint/tendermint/libs/pubsub/query" "github.com/tendermint/tendermint/state/txindex" "github.com/tendermint/tendermint/types" @@ -69,9 +70,9 @@ func TestTxSearch(t *testing.T) { indexer := NewTxIndex(db.NewMemDB(), IndexEvents(allowedKeys)) txResult := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number"), Value: []byte("1")}}}, - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("owner"), Value: []byte("Ivan")}}}, - {Type: "", Attributes: []cmn.KVPair{{Key: []byte("not_allowed"), Value: []byte("Vlad")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number"), Value: []byte("1")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("owner"), Value: []byte("Ivan")}}}, + {Type: "", Attributes: []kv.Pair{{Key: []byte("not_allowed"), Value: []byte("Vlad")}}}, }) hash := txResult.Tx.Hash() @@ -137,7 +138,7 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { // index tx using events indexing (composite key) txResult1 := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number"), Value: []byte("1")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number"), Value: []byte("1")}}}, }) hash1 := txResult1.Tx.Hash() @@ -206,8 +207,8 @@ func TestTxSearchOneTxWithMultipleSameTagsButDifferentValues(t *testing.T) { indexer := NewTxIndex(db.NewMemDB(), IndexEvents(allowedKeys)) txResult := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number"), Value: []byte("1")}}}, - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number"), Value: []byte("2")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number"), Value: []byte("1")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number"), Value: []byte("2")}}}, }) err := indexer.Index(txResult) @@ -226,7 +227,7 @@ func TestTxSearchMultipleTxs(t *testing.T) { // indexed first, but bigger height (to test the order of transactions) txResult := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number"), Value: []byte("1")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number"), Value: []byte("1")}}}, }) txResult.Tx = types.Tx("Bob's account") @@ -237,7 +238,7 @@ func TestTxSearchMultipleTxs(t *testing.T) { // indexed second, but smaller height (to test the order of transactions) txResult2 := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number"), Value: []byte("2")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number"), Value: []byte("2")}}}, }) txResult2.Tx = types.Tx("Alice's account") txResult2.Height = 1 @@ -248,7 +249,7 @@ func TestTxSearchMultipleTxs(t *testing.T) { // indexed third (to test the order of transactions) txResult3 := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number"), Value: []byte("3")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number"), Value: []byte("3")}}}, }) txResult3.Tx = types.Tx("Jack's account") txResult3.Height = 1 @@ -259,7 +260,7 @@ func TestTxSearchMultipleTxs(t *testing.T) { // indexed fourth (to test we don't include txs with similar events) // https://github.com/tendermint/tendermint/issues/2908 txResult4 := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number.id"), Value: []byte("1")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number.id"), Value: []byte("1")}}}, }) txResult4.Tx = types.Tx("Mike's account") txResult4.Height = 2 @@ -278,8 +279,8 @@ func TestIndexAllTags(t *testing.T) { indexer := NewTxIndex(db.NewMemDB(), IndexAllEvents()) txResult := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("owner"), Value: []byte("Ivan")}}}, - {Type: "account", Attributes: []cmn.KVPair{{Key: []byte("number"), Value: []byte("1")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("owner"), Value: []byte("Ivan")}}}, + {Type: "account", Attributes: []kv.Pair{{Key: []byte("number"), Value: []byte("1")}}}, }) err := indexer.Index(txResult) diff --git a/libs/common/int.go b/state/txindex/kv/utils.go similarity index 70% rename from libs/common/int.go rename to state/txindex/kv/utils.go index 845dc97f6..48362bfbc 100644 --- a/libs/common/int.go +++ b/state/txindex/kv/utils.go @@ -1,7 +1,7 @@ -package common +package kv // IntInSlice returns true if a is found in the list. -func IntInSlice(a int, list []int) bool { +func intInSlice(a int, list []int) bool { for _, b := range list { if b == a { return true diff --git a/state/txindex/kv/utils_test.go b/state/txindex/kv/utils_test.go new file mode 100644 index 000000000..5606de921 --- /dev/null +++ b/state/txindex/kv/utils_test.go @@ -0,0 +1,14 @@ +package kv + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestIntInSlice(t *testing.T) { + assert.True(t, intInSlice(1, []int{1, 2, 3})) + assert.False(t, intInSlice(4, []int{1, 2, 3})) + assert.True(t, intInSlice(0, []int{0})) + assert.False(t, intInSlice(0, []int{})) +} diff --git a/types/event_bus_test.go b/types/event_bus_test.go index c56f2b244..edc473f2c 100644 --- a/types/event_bus_test.go +++ b/types/event_bus_test.go @@ -11,6 +11,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/libs/kv" tmpubsub "github.com/tendermint/tendermint/libs/pubsub" tmquery "github.com/tendermint/tendermint/libs/pubsub/query" ) @@ -25,7 +26,7 @@ func TestEventBusPublishEventTx(t *testing.T) { result := abci.ResponseDeliverTx{ Data: []byte("bar"), Events: []abci.Event{ - {Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("baz"), Value: []byte("1")}}}, + {Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}}, }, } @@ -69,12 +70,12 @@ func TestEventBusPublishEventNewBlock(t *testing.T) { block := MakeBlock(0, []Tx{}, nil, []Evidence{}) resultBeginBlock := abci.ResponseBeginBlock{ Events: []abci.Event{ - {Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("baz"), Value: []byte("1")}}}, + {Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}}, }, } resultEndBlock := abci.ResponseEndBlock{ Events: []abci.Event{ - {Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("foz"), Value: []byte("2")}}}, + {Type: "testType", Attributes: []kv.Pair{{Key: []byte("foz"), Value: []byte("2")}}}, }, } @@ -119,7 +120,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { Events: []abci.Event{ { Type: "transfer", - Attributes: []cmn.KVPair{ + Attributes: []kv.Pair{ {Key: []byte("sender"), Value: []byte("foo")}, {Key: []byte("recipient"), Value: []byte("bar")}, {Key: []byte("amount"), Value: []byte("5")}, @@ -127,7 +128,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { }, { Type: "transfer", - Attributes: []cmn.KVPair{ + Attributes: []kv.Pair{ {Key: []byte("sender"), Value: []byte("baz")}, {Key: []byte("recipient"), Value: []byte("cat")}, {Key: []byte("amount"), Value: []byte("13")}, @@ -135,7 +136,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { }, { Type: "withdraw.rewards", - Attributes: []cmn.KVPair{ + Attributes: []kv.Pair{ {Key: []byte("address"), Value: []byte("bar")}, {Key: []byte("source"), Value: []byte("iceman")}, {Key: []byte("amount"), Value: []byte("33")}, @@ -216,12 +217,12 @@ func TestEventBusPublishEventNewBlockHeader(t *testing.T) { block := MakeBlock(0, []Tx{}, nil, []Evidence{}) resultBeginBlock := abci.ResponseBeginBlock{ Events: []abci.Event{ - {Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("baz"), Value: []byte("1")}}}, + {Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}}, }, } resultEndBlock := abci.ResponseEndBlock{ Events: []abci.Event{ - {Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("foz"), Value: []byte("2")}}}, + {Type: "testType", Attributes: []kv.Pair{{Key: []byte("foz"), Value: []byte("2")}}}, }, }