diff --git a/abci/example/orderbook/app.go b/abci/example/orderbook/app.go index c2664a65c..19f4a2fbe 100644 --- a/abci/example/orderbook/app.go +++ b/abci/example/orderbook/app.go @@ -3,6 +3,7 @@ package orderbook import ( "bytes" "encoding/binary" + fmt "fmt" "github.com/cosmos/gogoproto/proto" dbm "github.com/tendermint/tm-db" @@ -89,28 +90,29 @@ func New(db dbm.DB) (*StateMachine, error) { publicKeys = make(map[string]struct{}) commodities = make(map[string]struct{}) pairs = make(map[string]*Pair) + markets = make(map[string]*Market) lastHeight uint64 lastHash []byte ) for ; iter.Valid(); iter.Next() { if bytes.HasPrefix(iter.Key(), pairKey) { - var pair *Pair - if err := proto.Unmarshal(iter.Value(), pair); err != nil { + var pair Pair + if err := proto.Unmarshal(iter.Value(), &pair); err != nil { return nil, err } - pairs[pair.String()] = pair + pairs[pair.String()] = &pair commodities[pair.BuyersDenomination] = struct{}{} - + markets[pair.String()] = NewMarket(&pair) } if bytes.HasPrefix(iter.Key(), accountKey) { - var acc *Account - if err := proto.Unmarshal(iter.Value(), acc); err != nil { + var acc Account + if err := proto.Unmarshal(iter.Value(), &acc); err != nil { return nil, err } - accounts = append(accounts, acc) + accounts = append(accounts, &acc) publicKeys[string(acc.PublicKey)] = struct{}{} } @@ -119,13 +121,6 @@ func New(db dbm.DB) (*StateMachine, error) { lastHeight = binary.BigEndian.Uint64(state[:4]) lastHash = state[4:] } - - var acc *Account - if err := proto.Unmarshal(iter.Value(), acc); err != nil { - return nil, err - } - - accounts = append(accounts, acc) } return &StateMachine{ @@ -133,7 +128,7 @@ func New(db dbm.DB) (*StateMachine, error) { pairs: pairs, commodities: commodities, publicKeys: publicKeys, - markets: make(map[string]*Market), + markets: markets, lastHeight: int64(lastHeight), lastHash: lastHash, db: db, @@ -408,10 +403,7 @@ func (sm *StateMachine) Commit() types.ResponseCommit { if err != nil { panic(err) } - var key []byte - copy(key, accountKey) - binary.BigEndian.PutUint64(key, accountID) - + key := binary.BigEndian.AppendUint64(accountKey, accountID) if err := batch.Set(key, value); err != nil { panic(err) } @@ -424,9 +416,7 @@ func (sm *StateMachine) Commit() types.ResponseCommit { if err != nil { panic(err) } - var key []byte - copy(key, pairKey) - binary.BigEndian.PutUint64(key, uint64(pairID+id)) + key := binary.BigEndian.AppendUint64(pairKey, uint64(pairID+id)) if err := batch.Set(key, value); err != nil { panic(err) } @@ -536,6 +526,37 @@ func (sm *StateMachine) isMatchedOrderValid(order *MatchedOrder, pair *Pair) boo return true } +// InitDB takes an empty DB instance and populates it with the +// provided pairs and accounts. Note that the order here is important +func InitDB(db dbm.DB, pairs []*Pair, accounts []*Account) error { + batch := db.NewBatch() + + for id, account := range accounts { + value, err := proto.Marshal(account) + if err != nil { + return err + } + key := binary.BigEndian.AppendUint64(accountKey, uint64(id)) + if err := batch.Set(key, value); err != nil { + return err + } + } + + for id, pair := range pairs { + value, err := proto.Marshal(pair) + if err != nil { + return err + } + key := binary.BigEndian.AppendUint64(pairKey, uint64(id)) + fmt.Println(key) + if err := batch.Set(key, value); err != nil { + return err + } + } + + return batch.WriteSync() +} + func rejectProposal() types.ResponseProcessProposal { return types.ResponseProcessProposal{Status: types.ResponseProcessProposal_REJECT} } diff --git a/abci/example/orderbook/app_test.go b/abci/example/orderbook/app_test.go index 148a61dc7..3f5b1e310 100644 --- a/abci/example/orderbook/app_test.go +++ b/abci/example/orderbook/app_test.go @@ -1,6 +1,7 @@ package orderbook_test import ( + "crypto/ed25519" "testing" "github.com/cosmos/gogoproto/proto" @@ -9,56 +10,65 @@ import ( "github.com/tendermint/tendermint/abci/example/orderbook" "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/crypto" ) // TODO: we should also check that CheckTx adds bids and asks to the app-side mempool func TestCheckTx(t *testing.T) { - app, err := orderbook.New(dbm.NewMemDB()) + db := dbm.NewMemDB() + require.NoError(t, orderbook.InitDB(db, []*orderbook.Pair{testPair}, nil)) + app, err := orderbook.New(db) require.NoError(t, err) testCases := []struct { name string msg *orderbook.Msg - responseCode int + responseCode uint32 + expOrderSize int }{ - { - name: "test empty tx", - msg: &orderbook.Msg{}, - responseCode: orderbook.StatusErrUnknownMessage, - }, + // { + // name: "test empty tx", + // msg: &orderbook.Msg{}, + // responseCode: orderbook.StatusErrUnknownMessage, + // }, { name: "test msg ask", - msg: &orderbook.Msg{Sum: &orderbook.Msg_MsgAsk{MsgAsk: &orderbook.MsgAsk{ - Pair: testPair, - AskOrder: &orderbook.OrderAsk{ - Quantity: 10, - AskPrice: 1, - OwnerId: 1, - Signature: []byte("signature"), + msg: &orderbook.Msg{ + Sum: &orderbook.Msg_MsgAsk{ + MsgAsk: &orderbook.MsgAsk{ + Pair: testPair, + AskOrder: &orderbook.OrderAsk{ + Quantity: 10, + AskPrice: 1, + OwnerId: 1, + Signature: crypto.CRandBytes(ed25519.SignatureSize), + }, + }, }, - }}}, - responseCode: orderbook.StatusOK, - }, - { - name: "test msg bid", - msg: &orderbook.Msg{Sum: &orderbook.Msg_MsgBid{MsgBid: &orderbook.MsgBid{ - Pair: testPair, - BidOrder: &orderbook.OrderBid{ - MaxQuantity: 15, - MaxPrice: 5, - OwnerId: 1, - Signature: []byte("signature"), - }, - }}}, - responseCode: orderbook.StatusOK, - }, - { - name: "test msg register pair", - msg: &orderbook.Msg{Sum: &orderbook.Msg_MsgRegisterPair{MsgRegisterPair: &orderbook.MsgRegisterPair{ - Pair: testPair, - }}}, + }, responseCode: orderbook.StatusOK, + expOrderSize: 1, }, + // { + // name: "test msg bid", + // msg: &orderbook.Msg{Sum: &orderbook.Msg_MsgBid{MsgBid: &orderbook.MsgBid{ + // Pair: testPair, + // BidOrder: &orderbook.OrderBid{ + // MaxQuantity: 15, + // MaxPrice: 5, + // OwnerId: 1, + // Signature: []byte("signature"), + // }, + // }}}, + // responseCode: orderbook.StatusOK, + // }, + // { + // name: "test msg register pair", + // msg: &orderbook.Msg{Sum: &orderbook.Msg_MsgRegisterPair{MsgRegisterPair: &orderbook.MsgRegisterPair{ + // Pair: testPair, + // }}}, + // responseCode: orderbook.StatusOK, + // }, } for _, tc := range testCases { @@ -66,7 +76,9 @@ func TestCheckTx(t *testing.T) { bz, err := proto.Marshal(tc.msg) require.NoError(t, err) resp := app.CheckTx(types.RequestCheckTx{Tx: bz}) - require.Equal(t, tc.responseCode, resp.Code) + require.Equal(t, tc.responseCode, resp.Code, resp.Log) + bids, asks := app.Orders(testPair) + require.Equal(t, tc.expOrderSize, len(bids) + len(asks)) }) } } diff --git a/abci/example/orderbook/buf.gen.yaml b/abci/example/orderbook/buf.gen.yaml new file mode 100644 index 000000000..a6bc34385 --- /dev/null +++ b/abci/example/orderbook/buf.gen.yaml @@ -0,0 +1,9 @@ +version: v1 +plugins: + - name: gogofaster + out: . + opt: + - Mgoogle/protobuf/timestamp.proto=github.com/cosmos/gogoproto/types + - Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration + - plugins=grpc + - paths=source_relative diff --git a/abci/example/orderbook/doc.go b/abci/example/orderbook/doc.go index b2515d7ca..ec2fb9713 100644 --- a/abci/example/orderbook/doc.go +++ b/abci/example/orderbook/doc.go @@ -1,5 +1,5 @@ -//go:generate go install google.golang.org/protobuf/cmd/protoc-gen-go@latest -//go:generate protoc -I. -I../.. --go_out=. --go_opt=paths=source_relative wire.proto msgs.proto +//go:generate go install github.com/bufbuild/buf/cmd/buf +//go:generate buf generate // The orderbook presents a more advanced example of a Tendermint application than the simple kvstore // diff --git a/abci/example/orderbook/msgs.pb.go b/abci/example/orderbook/msgs.pb.go index 35a198f6a..2a0b4cf5e 100644 --- a/abci/example/orderbook/msgs.pb.go +++ b/abci/example/orderbook/msgs.pb.go @@ -1,293 +1,275 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.7 +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: msgs.proto package orderbook import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// 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 type MsgBid struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` BidOrder *OrderBid `protobuf:"bytes,2,opt,name=bid_order,json=bidOrder,proto3" json:"bid_order,omitempty"` } -func (x *MsgBid) Reset() { - *x = MsgBid{} - if protoimpl.UnsafeEnabled { - mi := &file_msgs_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgBid) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgBid) ProtoMessage() {} - -func (x *MsgBid) ProtoReflect() protoreflect.Message { - mi := &file_msgs_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgBid.ProtoReflect.Descriptor instead. +func (m *MsgBid) Reset() { *m = MsgBid{} } +func (m *MsgBid) String() string { return proto.CompactTextString(m) } +func (*MsgBid) ProtoMessage() {} func (*MsgBid) Descriptor() ([]byte, []int) { - return file_msgs_proto_rawDescGZIP(), []int{0} + return fileDescriptor_952909143bb80d72, []int{0} +} +func (m *MsgBid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBid.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 *MsgBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBid.Merge(m, src) +} +func (m *MsgBid) XXX_Size() int { + return m.Size() +} +func (m *MsgBid) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBid.DiscardUnknown(m) } -func (x *MsgBid) GetPair() *Pair { - if x != nil { - return x.Pair +var xxx_messageInfo_MsgBid proto.InternalMessageInfo + +func (m *MsgBid) GetPair() *Pair { + if m != nil { + return m.Pair } return nil } -func (x *MsgBid) GetBidOrder() *OrderBid { - if x != nil { - return x.BidOrder +func (m *MsgBid) GetBidOrder() *OrderBid { + if m != nil { + return m.BidOrder } return nil } type MsgAsk struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` AskOrder *OrderAsk `protobuf:"bytes,2,opt,name=ask_order,json=askOrder,proto3" json:"ask_order,omitempty"` } -func (x *MsgAsk) Reset() { - *x = MsgAsk{} - if protoimpl.UnsafeEnabled { - mi := &file_msgs_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgAsk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgAsk) ProtoMessage() {} - -func (x *MsgAsk) ProtoReflect() protoreflect.Message { - mi := &file_msgs_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgAsk.ProtoReflect.Descriptor instead. +func (m *MsgAsk) Reset() { *m = MsgAsk{} } +func (m *MsgAsk) String() string { return proto.CompactTextString(m) } +func (*MsgAsk) ProtoMessage() {} func (*MsgAsk) Descriptor() ([]byte, []int) { - return file_msgs_proto_rawDescGZIP(), []int{1} + return fileDescriptor_952909143bb80d72, []int{1} +} +func (m *MsgAsk) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAsk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAsk.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 *MsgAsk) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAsk.Merge(m, src) +} +func (m *MsgAsk) XXX_Size() int { + return m.Size() +} +func (m *MsgAsk) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAsk.DiscardUnknown(m) } -func (x *MsgAsk) GetPair() *Pair { - if x != nil { - return x.Pair +var xxx_messageInfo_MsgAsk proto.InternalMessageInfo + +func (m *MsgAsk) GetPair() *Pair { + if m != nil { + return m.Pair } return nil } -func (x *MsgAsk) GetAskOrder() *OrderAsk { - if x != nil { - return x.AskOrder +func (m *MsgAsk) GetAskOrder() *OrderAsk { + if m != nil { + return m.AskOrder } return nil } type MsgCreateAccount struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` Commodities []*Commodity `protobuf:"bytes,2,rep,name=commodities,proto3" json:"commodities,omitempty"` } -func (x *MsgCreateAccount) Reset() { - *x = MsgCreateAccount{} - if protoimpl.UnsafeEnabled { - mi := &file_msgs_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgCreateAccount) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgCreateAccount) ProtoMessage() {} - -func (x *MsgCreateAccount) ProtoReflect() protoreflect.Message { - mi := &file_msgs_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgCreateAccount.ProtoReflect.Descriptor instead. +func (m *MsgCreateAccount) Reset() { *m = MsgCreateAccount{} } +func (m *MsgCreateAccount) String() string { return proto.CompactTextString(m) } +func (*MsgCreateAccount) ProtoMessage() {} func (*MsgCreateAccount) Descriptor() ([]byte, []int) { - return file_msgs_proto_rawDescGZIP(), []int{2} + return fileDescriptor_952909143bb80d72, []int{2} +} +func (m *MsgCreateAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateAccount.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 *MsgCreateAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateAccount.Merge(m, src) +} +func (m *MsgCreateAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateAccount.DiscardUnknown(m) } -func (x *MsgCreateAccount) GetPublicKey() []byte { - if x != nil { - return x.PublicKey +var xxx_messageInfo_MsgCreateAccount proto.InternalMessageInfo + +func (m *MsgCreateAccount) GetPublicKey() []byte { + if m != nil { + return m.PublicKey } return nil } -func (x *MsgCreateAccount) GetCommodities() []*Commodity { - if x != nil { - return x.Commodities +func (m *MsgCreateAccount) GetCommodities() []*Commodity { + if m != nil { + return m.Commodities } return nil } type MsgRegisterPair struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` } -func (x *MsgRegisterPair) Reset() { - *x = MsgRegisterPair{} - if protoimpl.UnsafeEnabled { - mi := &file_msgs_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRegisterPair) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRegisterPair) ProtoMessage() {} - -func (x *MsgRegisterPair) ProtoReflect() protoreflect.Message { - mi := &file_msgs_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgRegisterPair.ProtoReflect.Descriptor instead. +func (m *MsgRegisterPair) Reset() { *m = MsgRegisterPair{} } +func (m *MsgRegisterPair) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterPair) ProtoMessage() {} func (*MsgRegisterPair) Descriptor() ([]byte, []int) { - return file_msgs_proto_rawDescGZIP(), []int{3} + return fileDescriptor_952909143bb80d72, []int{3} +} +func (m *MsgRegisterPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterPair.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 *MsgRegisterPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterPair.Merge(m, src) +} +func (m *MsgRegisterPair) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterPair) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterPair.DiscardUnknown(m) } -func (x *MsgRegisterPair) GetPair() *Pair { - if x != nil { - return x.Pair +var xxx_messageInfo_MsgRegisterPair proto.InternalMessageInfo + +func (m *MsgRegisterPair) GetPair() *Pair { + if m != nil { + return m.Pair } return nil } type MsgTradeSet struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - TradeSet *TradeSet `protobuf:"bytes,1,opt,name=trade_set,json=tradeSet,proto3" json:"trade_set,omitempty"` } -func (x *MsgTradeSet) Reset() { - *x = MsgTradeSet{} - if protoimpl.UnsafeEnabled { - mi := &file_msgs_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgTradeSet) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgTradeSet) ProtoMessage() {} - -func (x *MsgTradeSet) ProtoReflect() protoreflect.Message { - mi := &file_msgs_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgTradeSet.ProtoReflect.Descriptor instead. +func (m *MsgTradeSet) Reset() { *m = MsgTradeSet{} } +func (m *MsgTradeSet) String() string { return proto.CompactTextString(m) } +func (*MsgTradeSet) ProtoMessage() {} func (*MsgTradeSet) Descriptor() ([]byte, []int) { - return file_msgs_proto_rawDescGZIP(), []int{4} + return fileDescriptor_952909143bb80d72, []int{4} +} +func (m *MsgTradeSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTradeSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTradeSet.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 *MsgTradeSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTradeSet.Merge(m, src) +} +func (m *MsgTradeSet) XXX_Size() int { + return m.Size() +} +func (m *MsgTradeSet) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTradeSet.DiscardUnknown(m) } -func (x *MsgTradeSet) GetTradeSet() *TradeSet { - if x != nil { - return x.TradeSet +var xxx_messageInfo_MsgTradeSet proto.InternalMessageInfo + +func (m *MsgTradeSet) GetTradeSet() *TradeSet { + if m != nil { + return m.TradeSet } return nil } type Msg struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // a Msg has to be one of the below - // - // Types that are assignable to Sum: + //a Msg has to be one of the below // + // Types that are valid to be assigned to Sum: // *Msg_MsgBid // *Msg_MsgAsk // *Msg_MsgRegisterPair @@ -296,37 +278,66 @@ type Msg struct { Sum isMsg_Sum `protobuf_oneof:"sum"` } -func (x *Msg) Reset() { - *x = Msg{} - if protoimpl.UnsafeEnabled { - mi := &file_msgs_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Msg) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Msg) ProtoMessage() {} - -func (x *Msg) ProtoReflect() protoreflect.Message { - mi := &file_msgs_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Msg.ProtoReflect.Descriptor instead. +func (m *Msg) Reset() { *m = Msg{} } +func (m *Msg) String() string { return proto.CompactTextString(m) } +func (*Msg) ProtoMessage() {} func (*Msg) Descriptor() ([]byte, []int) { - return file_msgs_proto_rawDescGZIP(), []int{5} + return fileDescriptor_952909143bb80d72, []int{5} } +func (m *Msg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Msg.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 *Msg) XXX_Merge(src proto.Message) { + xxx_messageInfo_Msg.Merge(m, src) +} +func (m *Msg) XXX_Size() int { + return m.Size() +} +func (m *Msg) XXX_DiscardUnknown() { + xxx_messageInfo_Msg.DiscardUnknown(m) +} + +var xxx_messageInfo_Msg proto.InternalMessageInfo + +type isMsg_Sum interface { + isMsg_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type Msg_MsgBid struct { + MsgBid *MsgBid `protobuf:"bytes,1,opt,name=msg_bid,json=msgBid,proto3,oneof" json:"msg_bid,omitempty"` +} +type Msg_MsgAsk struct { + MsgAsk *MsgAsk `protobuf:"bytes,2,opt,name=msg_ask,json=msgAsk,proto3,oneof" json:"msg_ask,omitempty"` +} +type Msg_MsgRegisterPair struct { + MsgRegisterPair *MsgRegisterPair `protobuf:"bytes,3,opt,name=msg_register_pair,json=msgRegisterPair,proto3,oneof" json:"msg_register_pair,omitempty"` +} +type Msg_MsgCreateAccount struct { + MsgCreateAccount *MsgCreateAccount `protobuf:"bytes,4,opt,name=msg_create_account,json=msgCreateAccount,proto3,oneof" json:"msg_create_account,omitempty"` +} +type Msg_MsgTradeSet struct { + MsgTradeSet *MsgTradeSet `protobuf:"bytes,5,opt,name=msg_trade_set,json=msgTradeSet,proto3,oneof" json:"msg_trade_set,omitempty"` +} + +func (*Msg_MsgBid) isMsg_Sum() {} +func (*Msg_MsgAsk) isMsg_Sum() {} +func (*Msg_MsgRegisterPair) isMsg_Sum() {} +func (*Msg_MsgCreateAccount) isMsg_Sum() {} +func (*Msg_MsgTradeSet) isMsg_Sum() {} func (m *Msg) GetSum() isMsg_Sum { if m != nil { @@ -335,282 +346,1450 @@ func (m *Msg) GetSum() isMsg_Sum { return nil } -func (x *Msg) GetMsgBid() *MsgBid { - if x, ok := x.GetSum().(*Msg_MsgBid); ok { +func (m *Msg) GetMsgBid() *MsgBid { + if x, ok := m.GetSum().(*Msg_MsgBid); ok { return x.MsgBid } return nil } -func (x *Msg) GetMsgAsk() *MsgAsk { - if x, ok := x.GetSum().(*Msg_MsgAsk); ok { +func (m *Msg) GetMsgAsk() *MsgAsk { + if x, ok := m.GetSum().(*Msg_MsgAsk); ok { return x.MsgAsk } return nil } -func (x *Msg) GetMsgRegisterPair() *MsgRegisterPair { - if x, ok := x.GetSum().(*Msg_MsgRegisterPair); ok { +func (m *Msg) GetMsgRegisterPair() *MsgRegisterPair { + if x, ok := m.GetSum().(*Msg_MsgRegisterPair); ok { return x.MsgRegisterPair } return nil } -func (x *Msg) GetMsgCreateAccount() *MsgCreateAccount { - if x, ok := x.GetSum().(*Msg_MsgCreateAccount); ok { +func (m *Msg) GetMsgCreateAccount() *MsgCreateAccount { + if x, ok := m.GetSum().(*Msg_MsgCreateAccount); ok { return x.MsgCreateAccount } return nil } -func (x *Msg) GetMsgTradeSet() *MsgTradeSet { - if x, ok := x.GetSum().(*Msg_MsgTradeSet); ok { +func (m *Msg) GetMsgTradeSet() *MsgTradeSet { + if x, ok := m.GetSum().(*Msg_MsgTradeSet); ok { return x.MsgTradeSet } return nil } -type isMsg_Sum interface { - isMsg_Sum() -} - -type Msg_MsgBid struct { - MsgBid *MsgBid `protobuf:"bytes,1,opt,name=msg_bid,json=msgBid,proto3,oneof"` -} - -type Msg_MsgAsk struct { - MsgAsk *MsgAsk `protobuf:"bytes,2,opt,name=msg_ask,json=msgAsk,proto3,oneof"` -} - -type Msg_MsgRegisterPair struct { - MsgRegisterPair *MsgRegisterPair `protobuf:"bytes,3,opt,name=msg_register_pair,json=msgRegisterPair,proto3,oneof"` -} - -type Msg_MsgCreateAccount struct { - MsgCreateAccount *MsgCreateAccount `protobuf:"bytes,4,opt,name=msg_create_account,json=msgCreateAccount,proto3,oneof"` -} - -type Msg_MsgTradeSet struct { - MsgTradeSet *MsgTradeSet `protobuf:"bytes,5,opt,name=msg_trade_set,json=msgTradeSet,proto3,oneof"` -} - -func (*Msg_MsgBid) isMsg_Sum() {} - -func (*Msg_MsgAsk) isMsg_Sum() {} - -func (*Msg_MsgRegisterPair) isMsg_Sum() {} - -func (*Msg_MsgCreateAccount) isMsg_Sum() {} - -func (*Msg_MsgTradeSet) isMsg_Sum() {} - -var File_msgs_proto protoreflect.FileDescriptor - -var file_msgs_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x6d, 0x73, 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x0a, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x06, 0x4d, 0x73, 0x67, 0x42, 0x69, 0x64, 0x12, 0x23, 0x0a, - 0x04, 0x70, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x52, 0x04, 0x70, 0x61, - 0x69, 0x72, 0x12, 0x30, 0x0a, 0x09, 0x62, 0x69, 0x64, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, - 0x6b, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x52, 0x08, 0x62, 0x69, 0x64, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x22, 0x5f, 0x0a, 0x06, 0x4d, 0x73, 0x67, 0x41, 0x73, 0x6b, 0x12, 0x23, - 0x0a, 0x04, 0x70, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x52, 0x04, 0x70, - 0x61, 0x69, 0x72, 0x12, 0x30, 0x0a, 0x09, 0x61, 0x73, 0x6b, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, - 0x6f, 0x6b, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x73, 0x6b, 0x52, 0x08, 0x61, 0x73, 0x6b, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x69, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x64, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, - 0x69, 0x74, 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x22, 0x36, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, - 0x61, 0x69, 0x72, 0x12, 0x23, 0x0a, 0x04, 0x70, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x50, 0x61, - 0x69, 0x72, 0x52, 0x04, 0x70, 0x61, 0x69, 0x72, 0x22, 0x3f, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x54, - 0x72, 0x61, 0x64, 0x65, 0x53, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x64, 0x65, - 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x54, 0x72, 0x61, 0x64, 0x65, 0x53, 0x65, 0x74, 0x52, - 0x08, 0x74, 0x72, 0x61, 0x64, 0x65, 0x53, 0x65, 0x74, 0x22, 0xbd, 0x02, 0x0a, 0x03, 0x4d, 0x73, - 0x67, 0x12, 0x2c, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x4d, - 0x73, 0x67, 0x42, 0x69, 0x64, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x73, 0x67, 0x42, 0x69, 0x64, 0x12, - 0x2c, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x5f, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x4d, 0x73, 0x67, - 0x41, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x73, 0x67, 0x41, 0x73, 0x6b, 0x12, 0x48, 0x0a, - 0x11, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x61, - 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x50, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x0f, 0x6d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x4b, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x5f, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x48, 0x00, 0x52, 0x10, 0x6d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x72, 0x61, 0x64, - 0x65, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x64, 0x65, - 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x64, 0x65, 0x53, - 0x65, 0x74, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x61, 0x62, - 0x63, 0x69, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x62, 0x6f, 0x6f, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_msgs_proto_rawDescOnce sync.Once - file_msgs_proto_rawDescData = file_msgs_proto_rawDesc -) - -func file_msgs_proto_rawDescGZIP() []byte { - file_msgs_proto_rawDescOnce.Do(func() { - file_msgs_proto_rawDescData = protoimpl.X.CompressGZIP(file_msgs_proto_rawDescData) - }) - return file_msgs_proto_rawDescData -} - -var file_msgs_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_msgs_proto_goTypes = []interface{}{ - (*MsgBid)(nil), // 0: orderbook.MsgBid - (*MsgAsk)(nil), // 1: orderbook.MsgAsk - (*MsgCreateAccount)(nil), // 2: orderbook.MsgCreateAccount - (*MsgRegisterPair)(nil), // 3: orderbook.MsgRegisterPair - (*MsgTradeSet)(nil), // 4: orderbook.MsgTradeSet - (*Msg)(nil), // 5: orderbook.Msg - (*Pair)(nil), // 6: orderbook.Pair - (*OrderBid)(nil), // 7: orderbook.OrderBid - (*OrderAsk)(nil), // 8: orderbook.OrderAsk - (*Commodity)(nil), // 9: orderbook.Commodity - (*TradeSet)(nil), // 10: orderbook.TradeSet -} -var file_msgs_proto_depIdxs = []int32{ - 6, // 0: orderbook.MsgBid.pair:type_name -> orderbook.Pair - 7, // 1: orderbook.MsgBid.bid_order:type_name -> orderbook.OrderBid - 6, // 2: orderbook.MsgAsk.pair:type_name -> orderbook.Pair - 8, // 3: orderbook.MsgAsk.ask_order:type_name -> orderbook.OrderAsk - 9, // 4: orderbook.MsgCreateAccount.commodities:type_name -> orderbook.Commodity - 6, // 5: orderbook.MsgRegisterPair.pair:type_name -> orderbook.Pair - 10, // 6: orderbook.MsgTradeSet.trade_set:type_name -> orderbook.TradeSet - 0, // 7: orderbook.Msg.msg_bid:type_name -> orderbook.MsgBid - 1, // 8: orderbook.Msg.msg_ask:type_name -> orderbook.MsgAsk - 3, // 9: orderbook.Msg.msg_register_pair:type_name -> orderbook.MsgRegisterPair - 2, // 10: orderbook.Msg.msg_create_account:type_name -> orderbook.MsgCreateAccount - 4, // 11: orderbook.Msg.msg_trade_set:type_name -> orderbook.MsgTradeSet - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name -} - -func init() { file_msgs_proto_init() } -func file_msgs_proto_init() { - if File_msgs_proto != nil { - return - } - file_wire_proto_init() - if !protoimpl.UnsafeEnabled { - file_msgs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgBid); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msgs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgAsk); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msgs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgCreateAccount); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msgs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRegisterPair); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msgs_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgTradeSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msgs_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Msg); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_msgs_proto_msgTypes[5].OneofWrappers = []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Msg) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Msg_MsgBid)(nil), (*Msg_MsgAsk)(nil), (*Msg_MsgRegisterPair)(nil), (*Msg_MsgCreateAccount)(nil), (*Msg_MsgTradeSet)(nil), } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_msgs_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_msgs_proto_goTypes, - DependencyIndexes: file_msgs_proto_depIdxs, - MessageInfos: file_msgs_proto_msgTypes, - }.Build() - File_msgs_proto = out.File - file_msgs_proto_rawDesc = nil - file_msgs_proto_goTypes = nil - file_msgs_proto_depIdxs = nil } + +func init() { + proto.RegisterType((*MsgBid)(nil), "orderbook.MsgBid") + proto.RegisterType((*MsgAsk)(nil), "orderbook.MsgAsk") + proto.RegisterType((*MsgCreateAccount)(nil), "orderbook.MsgCreateAccount") + proto.RegisterType((*MsgRegisterPair)(nil), "orderbook.MsgRegisterPair") + proto.RegisterType((*MsgTradeSet)(nil), "orderbook.MsgTradeSet") + proto.RegisterType((*Msg)(nil), "orderbook.Msg") +} + +func init() { proto.RegisterFile("msgs.proto", fileDescriptor_952909143bb80d72) } + +var fileDescriptor_952909143bb80d72 = []byte{ + // 460 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x6f, 0xd3, 0x3e, + 0x18, 0x4d, 0xda, 0xad, 0xbf, 0xf6, 0xcb, 0x0f, 0x75, 0x0b, 0x08, 0x55, 0x43, 0x44, 0x53, 0xb9, + 0xec, 0x80, 0x5a, 0x34, 0xa4, 0x71, 0x41, 0x42, 0xed, 0x2e, 0x91, 0xa6, 0x08, 0x30, 0x9c, 0xb8, + 0x44, 0x4e, 0x6c, 0x19, 0x2b, 0x73, 0x5d, 0xf9, 0x73, 0x05, 0xfd, 0x2f, 0xf8, 0x87, 0xb8, 0x73, + 0xdc, 0x91, 0x23, 0x6a, 0xff, 0x11, 0x14, 0xc7, 0xdb, 0xd2, 0x1e, 0xd0, 0x6e, 0x9f, 0xed, 0xf7, + 0xbd, 0x97, 0xf7, 0x9e, 0x02, 0xa0, 0x50, 0xe0, 0x64, 0x69, 0xb4, 0xd5, 0xf1, 0x40, 0x1b, 0xc6, + 0x4d, 0xa1, 0x75, 0x75, 0x02, 0xdf, 0xa4, 0xe1, 0xcd, 0xf5, 0x38, 0x87, 0x5e, 0x86, 0x62, 0x2e, + 0x59, 0xfc, 0x02, 0x0e, 0x96, 0x54, 0x9a, 0x51, 0x78, 0x1a, 0x9e, 0x45, 0xe7, 0xc3, 0xc9, 0x1d, + 0x7e, 0xf2, 0x81, 0x4a, 0x43, 0xdc, 0x63, 0xfc, 0x0a, 0x06, 0x85, 0x64, 0xb9, 0x7b, 0x1b, 0x75, + 0x1c, 0xf2, 0x71, 0x0b, 0xf9, 0xbe, 0x9e, 0xe6, 0x92, 0x91, 0x7e, 0x21, 0x99, 0x3b, 0x78, 0x81, + 0x19, 0x56, 0x0f, 0x16, 0xa0, 0x58, 0xfd, 0x5b, 0x60, 0x86, 0x15, 0xe9, 0x53, 0xac, 0x1a, 0x01, + 0x09, 0x47, 0x19, 0x8a, 0x4b, 0xc3, 0xa9, 0xe5, 0xb3, 0xb2, 0xd4, 0xab, 0x85, 0x8d, 0x9f, 0x03, + 0x2c, 0x57, 0xc5, 0xb5, 0x2c, 0xf3, 0x8a, 0xaf, 0x9d, 0xe0, 0xff, 0x64, 0xd0, 0xdc, 0x5c, 0xf1, + 0x75, 0x7c, 0x01, 0x51, 0xa9, 0x95, 0xd2, 0x4c, 0x5a, 0xc9, 0x71, 0xd4, 0x39, 0xed, 0x9e, 0x45, + 0xe7, 0x4f, 0x5a, 0x32, 0x97, 0xfe, 0x75, 0x4d, 0xda, 0xc0, 0xf1, 0x05, 0x0c, 0x33, 0x14, 0x84, + 0x0b, 0x89, 0x96, 0x9b, 0xfa, 0xab, 0x1f, 0x64, 0x6a, 0xfc, 0x0e, 0xa2, 0x0c, 0xc5, 0x67, 0x43, + 0x19, 0xff, 0xc4, 0x6d, 0xed, 0xd1, 0xd6, 0x73, 0x8e, 0xdc, 0xfa, 0xc5, 0xb6, 0xc7, 0x5b, 0x1c, + 0xe9, 0x5b, 0x3f, 0x8d, 0x7f, 0x76, 0xa0, 0x9b, 0xa1, 0x88, 0x5f, 0xc2, 0x7f, 0x0a, 0x45, 0x5e, + 0x48, 0xe6, 0xf7, 0x8e, 0x5b, 0x7b, 0x4d, 0x8f, 0x69, 0x40, 0x7a, 0xaa, 0x69, 0xd4, 0xa3, 0x29, + 0x56, 0x3e, 0xc9, 0x3d, 0xf4, 0x0c, 0x2b, 0x8f, 0xae, 0xeb, 0x49, 0xe1, 0xb8, 0x46, 0x1b, 0xef, + 0x2e, 0x77, 0xb6, 0xba, 0x6e, 0xef, 0x64, 0x77, 0xaf, 0x1d, 0x40, 0x1a, 0x90, 0xa1, 0xda, 0xcb, + 0xe4, 0x0a, 0xe2, 0x9a, 0xa9, 0x74, 0x95, 0xe4, 0xb4, 0xe9, 0x64, 0x74, 0xe0, 0xa8, 0x9e, 0xed, + 0x52, 0xed, 0xd4, 0x96, 0x06, 0xe4, 0x48, 0xed, 0x57, 0xf9, 0x16, 0x1e, 0xd5, 0x64, 0xf7, 0x81, + 0x1d, 0x3a, 0x9e, 0xa7, 0xbb, 0x3c, 0xb7, 0x99, 0xa5, 0x01, 0x89, 0xd4, 0xfd, 0x71, 0x7e, 0x08, + 0x5d, 0x5c, 0xa9, 0xf9, 0xc7, 0x5f, 0x9b, 0x24, 0xbc, 0xd9, 0x24, 0xe1, 0x9f, 0x4d, 0x12, 0xfe, + 0xd8, 0x26, 0xc1, 0xcd, 0x36, 0x09, 0x7e, 0x6f, 0x93, 0xe0, 0xcb, 0x1b, 0x21, 0xed, 0xd7, 0x55, + 0x31, 0x29, 0xb5, 0x9a, 0x5a, 0xbe, 0x60, 0xdc, 0x28, 0xb9, 0xb0, 0xed, 0x91, 0x16, 0xa5, 0x9c, + 0xf2, 0xef, 0x54, 0x2d, 0xaf, 0xf9, 0xf4, 0x4e, 0xb4, 0xe8, 0xb9, 0xff, 0xe7, 0xf5, 0xdf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x14, 0xd7, 0x67, 0x64, 0x64, 0x03, 0x00, 0x00, +} + +func (m *MsgBid) 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 *MsgBid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BidOrder != nil { + { + size, err := m.BidOrder.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Pair != nil { + { + size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAsk) 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 *MsgAsk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAsk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AskOrder != nil { + { + size, err := m.AskOrder.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Pair != nil { + { + size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateAccount) 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 *MsgCreateAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Commodities) > 0 { + for iNdEx := len(m.Commodities) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Commodities[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterPair) 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 *MsgRegisterPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pair != nil { + { + size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTradeSet) 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 *MsgTradeSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTradeSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TradeSet != nil { + { + size, err := m.TradeSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Msg) 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 *Msg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Msg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Msg_MsgBid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Msg_MsgBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.MsgBid != nil { + { + size, err := m.MsgBid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Msg_MsgAsk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Msg_MsgAsk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.MsgAsk != nil { + { + size, err := m.MsgAsk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Msg_MsgRegisterPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Msg_MsgRegisterPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.MsgRegisterPair != nil { + { + size, err := m.MsgRegisterPair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Msg_MsgCreateAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Msg_MsgCreateAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.MsgCreateAccount != nil { + { + size, err := m.MsgCreateAccount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Msg_MsgTradeSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Msg_MsgTradeSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.MsgTradeSet != nil { + { + size, err := m.MsgTradeSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int { + offset -= sovMsgs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgBid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pair != nil { + l = m.Pair.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + if m.BidOrder != nil { + l = m.BidOrder.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgAsk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pair != nil { + l = m.Pair.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + if m.AskOrder != nil { + l = m.AskOrder.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgCreateAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if len(m.Commodities) > 0 { + for _, e := range m.Commodities { + l = e.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + } + return n +} + +func (m *MsgRegisterPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pair != nil { + l = m.Pair.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgTradeSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TradeSet != nil { + l = m.TradeSet.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *Msg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Msg_MsgBid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgBid != nil { + l = m.MsgBid.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} +func (m *Msg_MsgAsk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgAsk != nil { + l = m.MsgAsk.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} +func (m *Msg_MsgRegisterPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgRegisterPair != nil { + l = m.MsgRegisterPair.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} +func (m *Msg_MsgCreateAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgCreateAccount != nil { + l = m.MsgCreateAccount.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} +func (m *Msg_MsgTradeSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgTradeSet != nil { + l = m.MsgTradeSet.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func sovMsgs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMsgs(x uint64) (n int) { + return sovMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgBid) 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 ErrIntOverflowMsgs + } + 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: MsgBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pair == nil { + m.Pair = &Pair{} + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidOrder", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BidOrder == nil { + m.BidOrder = &OrderBid{} + } + if err := m.BidOrder.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAsk) 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 ErrIntOverflowMsgs + } + 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: MsgAsk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAsk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pair == nil { + m.Pair = &Pair{} + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AskOrder", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AskOrder == nil { + m.AskOrder = &OrderAsk{} + } + if err := m.AskOrder.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateAccount) 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 ErrIntOverflowMsgs + } + 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: MsgCreateAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commodities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Commodities = append(m.Commodities, &Commodity{}) + if err := m.Commodities[len(m.Commodities)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterPair) 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 ErrIntOverflowMsgs + } + 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: MsgRegisterPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pair == nil { + m.Pair = &Pair{} + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTradeSet) 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 ErrIntOverflowMsgs + } + 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: MsgTradeSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTradeSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradeSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TradeSet == nil { + m.TradeSet = &TradeSet{} + } + if err := m.TradeSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Msg) 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 ErrIntOverflowMsgs + } + 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: Msg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Msg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgBid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgBid{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Msg_MsgBid{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgAsk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgAsk{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Msg_MsgAsk{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgRegisterPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgRegisterPair{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Msg_MsgRegisterPair{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgCreateAccount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgCreateAccount{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Msg_MsgCreateAccount{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgTradeSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgTradeSet{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Msg_MsgTradeSet{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMsgs(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, ErrIntOverflowMsgs + } + 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, ErrIntOverflowMsgs + } + 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, ErrIntOverflowMsgs + } + 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, ErrInvalidLengthMsgs + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMsgs + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMsgs + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMsgs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMsgs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group") +) diff --git a/abci/example/orderbook/store.go b/abci/example/orderbook/store.go deleted file mode 100644 index 8f2da4f8e..000000000 --- a/abci/example/orderbook/store.go +++ /dev/null @@ -1,11 +0,0 @@ -package orderbook - -import dbm "github.com/tendermint/tm-db" - -type AccountStore struct { - db dbm.DB -} - -// iterate over the account database -// Add to the account database -// find an account diff --git a/abci/example/orderbook/wire.pb.go b/abci/example/orderbook/wire.pb.go index e6d65fbed..8b5f6457d 100644 --- a/abci/example/orderbook/wire.pb.go +++ b/abci/example/orderbook/wire.pb.go @@ -1,339 +1,328 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.7 +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: wire.proto package orderbook import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" + encoding_binary "encoding/binary" + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// 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 type OrderAsk struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - Quantity float64 `protobuf:"fixed64,1,opt,name=quantity,proto3" json:"quantity,omitempty"` AskPrice float64 `protobuf:"fixed64,2,opt,name=ask_price,json=askPrice,proto3" json:"ask_price,omitempty"` OwnerId uint64 `protobuf:"varint,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` } -func (x *OrderAsk) Reset() { - *x = OrderAsk{} - if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OrderAsk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrderAsk) ProtoMessage() {} - -func (x *OrderAsk) ProtoReflect() protoreflect.Message { - mi := &file_wire_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OrderAsk.ProtoReflect.Descriptor instead. +func (m *OrderAsk) Reset() { *m = OrderAsk{} } +func (m *OrderAsk) String() string { return proto.CompactTextString(m) } +func (*OrderAsk) ProtoMessage() {} func (*OrderAsk) Descriptor() ([]byte, []int) { - return file_wire_proto_rawDescGZIP(), []int{0} + return fileDescriptor_f2dcdddcdf68d8e0, []int{0} +} +func (m *OrderAsk) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OrderAsk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OrderAsk.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 *OrderAsk) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderAsk.Merge(m, src) +} +func (m *OrderAsk) XXX_Size() int { + return m.Size() +} +func (m *OrderAsk) XXX_DiscardUnknown() { + xxx_messageInfo_OrderAsk.DiscardUnknown(m) } -func (x *OrderAsk) GetQuantity() float64 { - if x != nil { - return x.Quantity +var xxx_messageInfo_OrderAsk proto.InternalMessageInfo + +func (m *OrderAsk) GetQuantity() float64 { + if m != nil { + return m.Quantity } return 0 } -func (x *OrderAsk) GetAskPrice() float64 { - if x != nil { - return x.AskPrice +func (m *OrderAsk) GetAskPrice() float64 { + if m != nil { + return m.AskPrice } return 0 } -func (x *OrderAsk) GetOwnerId() uint64 { - if x != nil { - return x.OwnerId +func (m *OrderAsk) GetOwnerId() uint64 { + if m != nil { + return m.OwnerId } return 0 } -func (x *OrderAsk) GetSignature() []byte { - if x != nil { - return x.Signature +func (m *OrderAsk) GetSignature() []byte { + if m != nil { + return m.Signature } return nil } type OrderBid struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - MaxQuantity float64 `protobuf:"fixed64,1,opt,name=max_quantity,json=maxQuantity,proto3" json:"max_quantity,omitempty"` MaxPrice float64 `protobuf:"fixed64,2,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` OwnerId uint64 `protobuf:"varint,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` } -func (x *OrderBid) Reset() { - *x = OrderBid{} - if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OrderBid) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrderBid) ProtoMessage() {} - -func (x *OrderBid) ProtoReflect() protoreflect.Message { - mi := &file_wire_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OrderBid.ProtoReflect.Descriptor instead. +func (m *OrderBid) Reset() { *m = OrderBid{} } +func (m *OrderBid) String() string { return proto.CompactTextString(m) } +func (*OrderBid) ProtoMessage() {} func (*OrderBid) Descriptor() ([]byte, []int) { - return file_wire_proto_rawDescGZIP(), []int{1} + return fileDescriptor_f2dcdddcdf68d8e0, []int{1} +} +func (m *OrderBid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OrderBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OrderBid.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 *OrderBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderBid.Merge(m, src) +} +func (m *OrderBid) XXX_Size() int { + return m.Size() +} +func (m *OrderBid) XXX_DiscardUnknown() { + xxx_messageInfo_OrderBid.DiscardUnknown(m) } -func (x *OrderBid) GetMaxQuantity() float64 { - if x != nil { - return x.MaxQuantity +var xxx_messageInfo_OrderBid proto.InternalMessageInfo + +func (m *OrderBid) GetMaxQuantity() float64 { + if m != nil { + return m.MaxQuantity } return 0 } -func (x *OrderBid) GetMaxPrice() float64 { - if x != nil { - return x.MaxPrice +func (m *OrderBid) GetMaxPrice() float64 { + if m != nil { + return m.MaxPrice } return 0 } -func (x *OrderBid) GetOwnerId() uint64 { - if x != nil { - return x.OwnerId +func (m *OrderBid) GetOwnerId() uint64 { + if m != nil { + return m.OwnerId } return 0 } -func (x *OrderBid) GetSignature() []byte { - if x != nil { - return x.Signature +func (m *OrderBid) GetSignature() []byte { + if m != nil { + return m.Signature } return nil } type Pair struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - // the denomination that the buyer receives i.e. EUR BuyersDenomination string `protobuf:"bytes,1,opt,name=buyers_denomination,json=buyersDenomination,proto3" json:"buyers_denomination,omitempty"` // the denomination that the seller receives i.e. USD SellersDenomination string `protobuf:"bytes,2,opt,name=sellers_denomination,json=sellersDenomination,proto3" json:"sellers_denomination,omitempty"` } -func (x *Pair) Reset() { - *x = Pair{} - if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Pair) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Pair) ProtoMessage() {} - -func (x *Pair) ProtoReflect() protoreflect.Message { - mi := &file_wire_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Pair.ProtoReflect.Descriptor instead. +func (m *Pair) Reset() { *m = Pair{} } +func (m *Pair) String() string { return proto.CompactTextString(m) } +func (*Pair) ProtoMessage() {} func (*Pair) Descriptor() ([]byte, []int) { - return file_wire_proto_rawDescGZIP(), []int{2} + return fileDescriptor_f2dcdddcdf68d8e0, []int{2} +} +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) } -func (x *Pair) GetBuyersDenomination() string { - if x != nil { - return x.BuyersDenomination +var xxx_messageInfo_Pair proto.InternalMessageInfo + +func (m *Pair) GetBuyersDenomination() string { + if m != nil { + return m.BuyersDenomination } return "" } -func (x *Pair) GetSellersDenomination() string { - if x != nil { - return x.SellersDenomination +func (m *Pair) GetSellersDenomination() string { + if m != nil { + return m.SellersDenomination } return "" } type Commodity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` Quantity float64 `protobuf:"fixed64,2,opt,name=quantity,proto3" json:"quantity,omitempty"` } -func (x *Commodity) Reset() { - *x = Commodity{} - if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Commodity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Commodity) ProtoMessage() {} - -func (x *Commodity) ProtoReflect() protoreflect.Message { - mi := &file_wire_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Commodity.ProtoReflect.Descriptor instead. +func (m *Commodity) Reset() { *m = Commodity{} } +func (m *Commodity) String() string { return proto.CompactTextString(m) } +func (*Commodity) ProtoMessage() {} func (*Commodity) Descriptor() ([]byte, []int) { - return file_wire_proto_rawDescGZIP(), []int{3} + return fileDescriptor_f2dcdddcdf68d8e0, []int{3} +} +func (m *Commodity) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Commodity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Commodity.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 *Commodity) XXX_Merge(src proto.Message) { + xxx_messageInfo_Commodity.Merge(m, src) +} +func (m *Commodity) XXX_Size() int { + return m.Size() +} +func (m *Commodity) XXX_DiscardUnknown() { + xxx_messageInfo_Commodity.DiscardUnknown(m) } -func (x *Commodity) GetDenom() string { - if x != nil { - return x.Denom +var xxx_messageInfo_Commodity proto.InternalMessageInfo + +func (m *Commodity) GetDenom() string { + if m != nil { + return m.Denom } return "" } -func (x *Commodity) GetQuantity() float64 { - if x != nil { - return x.Quantity +func (m *Commodity) GetQuantity() float64 { + if m != nil { + return m.Quantity } return 0 } +// Accounts is the atomic piece of information that is persisted to disk. type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // the set of commodities that the account has Commodities []*Commodity `protobuf:"bytes,3,rep,name=commodities,proto3" json:"commodities,omitempty"` } -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_wire_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (m *Account) Reset() { *m = Account{} } +func (m *Account) String() string { return proto.CompactTextString(m) } +func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { - return file_wire_proto_rawDescGZIP(), []int{4} + return fileDescriptor_f2dcdddcdf68d8e0, []int{4} +} +func (m *Account) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Account.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 *Account) XXX_Merge(src proto.Message) { + xxx_messageInfo_Account.Merge(m, src) +} +func (m *Account) XXX_Size() int { + return m.Size() +} +func (m *Account) XXX_DiscardUnknown() { + xxx_messageInfo_Account.DiscardUnknown(m) } -func (x *Account) GetIndex() uint64 { - if x != nil { - return x.Index +var xxx_messageInfo_Account proto.InternalMessageInfo + +func (m *Account) GetIndex() uint64 { + if m != nil { + return m.Index } return 0 } -func (x *Account) GetPublicKey() []byte { - if x != nil { - return x.PublicKey +func (m *Account) GetPublicKey() []byte { + if m != nil { + return m.PublicKey } return nil } -func (x *Account) GetCommodities() []*Commodity { - if x != nil { - return x.Commodities +func (m *Account) GetCommodities() []*Commodity { + if m != nil { + return m.Commodities } return nil } @@ -341,318 +330,1538 @@ func (x *Account) GetCommodities() []*Commodity { // TradeSet is the transaction that eventually is committed in a block // It is derived from a group of MsgBid and MsgAsk's type TradeSet struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` // i.e. EUR/USD + Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` // the set of matched trades for that peer MatchedOrders []*MatchedOrder `protobuf:"bytes,2,rep,name=matched_orders,json=matchedOrders,proto3" json:"matched_orders,omitempty"` } -func (x *TradeSet) Reset() { - *x = TradeSet{} - if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TradeSet) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TradeSet) ProtoMessage() {} - -func (x *TradeSet) ProtoReflect() protoreflect.Message { - mi := &file_wire_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TradeSet.ProtoReflect.Descriptor instead. +func (m *TradeSet) Reset() { *m = TradeSet{} } +func (m *TradeSet) String() string { return proto.CompactTextString(m) } +func (*TradeSet) ProtoMessage() {} func (*TradeSet) Descriptor() ([]byte, []int) { - return file_wire_proto_rawDescGZIP(), []int{5} + return fileDescriptor_f2dcdddcdf68d8e0, []int{5} +} +func (m *TradeSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TradeSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TradeSet.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 *TradeSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_TradeSet.Merge(m, src) +} +func (m *TradeSet) XXX_Size() int { + return m.Size() +} +func (m *TradeSet) XXX_DiscardUnknown() { + xxx_messageInfo_TradeSet.DiscardUnknown(m) } -func (x *TradeSet) GetPair() *Pair { - if x != nil { - return x.Pair +var xxx_messageInfo_TradeSet proto.InternalMessageInfo + +func (m *TradeSet) GetPair() *Pair { + if m != nil { + return m.Pair } return nil } -func (x *TradeSet) GetMatchedOrders() []*MatchedOrder { - if x != nil { - return x.MatchedOrders +func (m *TradeSet) GetMatchedOrders() []*MatchedOrder { + if m != nil { + return m.MatchedOrders } return nil } type MatchedOrder struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - OrderAsk *OrderAsk `protobuf:"bytes,1,opt,name=order_ask,json=orderAsk,proto3" json:"order_ask,omitempty"` OrderBid *OrderBid `protobuf:"bytes,2,opt,name=order_bid,json=orderBid,proto3" json:"order_bid,omitempty"` } -func (x *MatchedOrder) Reset() { - *x = MatchedOrder{} - if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MatchedOrder) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MatchedOrder) ProtoMessage() {} - -func (x *MatchedOrder) ProtoReflect() protoreflect.Message { - mi := &file_wire_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MatchedOrder.ProtoReflect.Descriptor instead. +func (m *MatchedOrder) Reset() { *m = MatchedOrder{} } +func (m *MatchedOrder) String() string { return proto.CompactTextString(m) } +func (*MatchedOrder) ProtoMessage() {} func (*MatchedOrder) Descriptor() ([]byte, []int) { - return file_wire_proto_rawDescGZIP(), []int{6} + return fileDescriptor_f2dcdddcdf68d8e0, []int{6} +} +func (m *MatchedOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MatchedOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MatchedOrder.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 *MatchedOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MatchedOrder.Merge(m, src) +} +func (m *MatchedOrder) XXX_Size() int { + return m.Size() +} +func (m *MatchedOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MatchedOrder.DiscardUnknown(m) } -func (x *MatchedOrder) GetOrderAsk() *OrderAsk { - if x != nil { - return x.OrderAsk +var xxx_messageInfo_MatchedOrder proto.InternalMessageInfo + +func (m *MatchedOrder) GetOrderAsk() *OrderAsk { + if m != nil { + return m.OrderAsk } return nil } -func (x *MatchedOrder) GetOrderBid() *OrderBid { - if x != nil { - return x.OrderBid +func (m *MatchedOrder) GetOrderBid() *OrderBid { + if m != nil { + return m.OrderBid } return nil } -var File_wire_proto protoreflect.FileDescriptor +func init() { + proto.RegisterType((*OrderAsk)(nil), "orderbook.OrderAsk") + proto.RegisterType((*OrderBid)(nil), "orderbook.OrderBid") + proto.RegisterType((*Pair)(nil), "orderbook.Pair") + proto.RegisterType((*Commodity)(nil), "orderbook.Commodity") + proto.RegisterType((*Account)(nil), "orderbook.Account") + proto.RegisterType((*TradeSet)(nil), "orderbook.TradeSet") + proto.RegisterType((*MatchedOrder)(nil), "orderbook.MatchedOrder") +} -var file_wire_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x22, 0x7c, 0x0a, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x41, 0x73, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, - 0x1b, 0x0a, 0x09, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x08, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, - 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x51, 0x75, 0x61, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x6a, 0x0a, 0x04, 0x50, - 0x61, 0x69, 0x72, 0x12, 0x2f, 0x0a, 0x13, 0x62, 0x75, 0x79, 0x65, 0x72, 0x73, 0x5f, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x12, 0x62, 0x75, 0x79, 0x65, 0x72, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x73, 0x5f, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x64, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, - 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x71, 0x75, - 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x76, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, - 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x6f, - 0x0a, 0x08, 0x54, 0x72, 0x61, 0x64, 0x65, 0x53, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x70, 0x61, - 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x52, 0x04, 0x70, 0x61, 0x69, 0x72, 0x12, - 0x3e, 0x0a, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, - 0x6f, 0x6f, 0x6b, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x22, - 0x72, 0x0a, 0x0c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, - 0x30, 0x0a, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x41, 0x73, 0x6b, 0x52, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x73, - 0x6b, 0x12, 0x30, 0x0a, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, - 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x52, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x42, 0x69, 0x64, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +func init() { proto.RegisterFile("wire.proto", fileDescriptor_f2dcdddcdf68d8e0) } + +var fileDescriptor_f2dcdddcdf68d8e0 = []byte{ + // 488 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0x8f, 0x12, 0x31, + 0x18, 0xc6, 0x19, 0x40, 0x97, 0x79, 0x41, 0x4d, 0x0a, 0x89, 0xe3, 0xbf, 0x09, 0x8e, 0x17, 0x4e, + 0xa0, 0x6b, 0xa2, 0x27, 0x4d, 0x16, 0xbd, 0x18, 0x63, 0xdc, 0xad, 0x9e, 0xbc, 0x4c, 0x3a, 0xd3, + 0x66, 0xb7, 0x0e, 0x6d, 0xb1, 0xed, 0xb8, 0x90, 0x78, 0xf3, 0x0b, 0xf8, 0xb1, 0x3c, 0xee, 0xd1, + 0xa3, 0x81, 0x2f, 0x62, 0xa6, 0x33, 0x8b, 0x45, 0xbd, 0x79, 0xe3, 0xe9, 0xf3, 0xfe, 0x78, 0x1e, + 0xda, 0x17, 0x80, 0x73, 0xae, 0xd9, 0x74, 0xa9, 0x95, 0x55, 0x28, 0x54, 0x9a, 0x32, 0x9d, 0x29, + 0x55, 0x24, 0x5f, 0xa0, 0xf7, 0xb6, 0x12, 0x47, 0xa6, 0x40, 0xb7, 0xa1, 0xf7, 0xa9, 0x24, 0xd2, + 0x72, 0xbb, 0x8e, 0x82, 0x71, 0x30, 0x09, 0xf0, 0x4e, 0xa3, 0x3b, 0x10, 0x12, 0x53, 0xa4, 0x4b, + 0xcd, 0x73, 0x16, 0xb5, 0x6b, 0x93, 0x98, 0xe2, 0xb8, 0xd2, 0xe8, 0x16, 0xf4, 0xd4, 0xb9, 0x64, + 0x3a, 0xe5, 0x34, 0xea, 0x8c, 0x83, 0x49, 0x17, 0x1f, 0x38, 0xfd, 0x8a, 0xa2, 0xbb, 0x10, 0x1a, + 0x7e, 0x2a, 0x89, 0x2d, 0x35, 0x8b, 0xba, 0xe3, 0x60, 0x32, 0xc0, 0xbf, 0x0f, 0x92, 0xaf, 0x41, + 0x13, 0x3f, 0xe7, 0x14, 0xdd, 0x87, 0x81, 0x20, 0xab, 0xf4, 0x8f, 0x0a, 0x7d, 0x41, 0x56, 0x27, + 0x5e, 0x8b, 0x6a, 0x64, 0xaf, 0x85, 0x20, 0xab, 0xff, 0x6c, 0xf1, 0x11, 0xba, 0xc7, 0x84, 0x6b, + 0x34, 0x83, 0x61, 0x56, 0xae, 0x99, 0x36, 0x29, 0x65, 0x52, 0x09, 0x2e, 0x89, 0xe5, 0x4a, 0xba, + 0x1e, 0x21, 0x46, 0xb5, 0xf5, 0xd2, 0x73, 0xd0, 0x23, 0x18, 0x19, 0xb6, 0x58, 0xfc, 0x45, 0xb4, + 0x1d, 0x31, 0x6c, 0x3c, 0x1f, 0x49, 0x9e, 0x41, 0xf8, 0x42, 0x09, 0xa1, 0x68, 0xf5, 0x73, 0x46, + 0x70, 0xc5, 0x71, 0x4d, 0x44, 0x2d, 0xf6, 0x9e, 0xa1, 0xbd, 0xff, 0x0c, 0xc9, 0x67, 0x38, 0x38, + 0xca, 0x73, 0x55, 0x4a, 0x5b, 0xc1, 0x5c, 0x52, 0xb6, 0x72, 0x70, 0x17, 0xd7, 0x02, 0xdd, 0x03, + 0x58, 0x96, 0xd9, 0x82, 0xe7, 0x69, 0xc1, 0x6a, 0x7c, 0x80, 0xc3, 0xfa, 0xe4, 0x35, 0x5b, 0xa3, + 0x27, 0xd0, 0xcf, 0x9b, 0x78, 0xce, 0x4c, 0xd4, 0x19, 0x77, 0x26, 0xfd, 0xc3, 0xd1, 0x74, 0xb7, + 0x0f, 0xd3, 0x5d, 0x39, 0xec, 0x0f, 0x26, 0x0a, 0x7a, 0xef, 0x35, 0xa1, 0xec, 0x1d, 0xb3, 0xe8, + 0x01, 0x74, 0x97, 0x84, 0x6b, 0x97, 0xdb, 0x3f, 0xbc, 0xe1, 0xc1, 0xd5, 0x2d, 0x62, 0x67, 0xa2, + 0xe7, 0x70, 0x5d, 0x10, 0x9b, 0x9f, 0x31, 0x9a, 0x3a, 0xdf, 0x44, 0x6d, 0x97, 0x75, 0xd3, 0x1b, + 0x7f, 0x53, 0x0f, 0xb8, 0x05, 0xc0, 0xd7, 0x84, 0xa7, 0x4c, 0xa2, 0x61, 0xe0, 0xdb, 0xe8, 0x21, + 0xd4, 0x4b, 0x9b, 0x12, 0x53, 0x34, 0xc9, 0x43, 0xef, 0xab, 0x2e, 0x77, 0x18, 0xf7, 0xd4, 0xe5, + 0x36, 0xef, 0x88, 0x8c, 0x53, 0x77, 0x11, 0xff, 0x20, 0xe6, 0x9c, 0x36, 0xc4, 0x9c, 0xd3, 0xf9, + 0xc9, 0xf7, 0x4d, 0x1c, 0x5c, 0x6c, 0xe2, 0xe0, 0xe7, 0x26, 0x0e, 0xbe, 0x6d, 0xe3, 0xd6, 0xc5, + 0x36, 0x6e, 0xfd, 0xd8, 0xc6, 0xad, 0x0f, 0x4f, 0x4f, 0xb9, 0x3d, 0x2b, 0xb3, 0x69, 0xae, 0xc4, + 0xcc, 0x32, 0x49, 0x99, 0x16, 0x5c, 0x5a, 0xff, 0x23, 0xc9, 0x72, 0x3e, 0x63, 0x2b, 0x22, 0x96, + 0x0b, 0x36, 0xdb, 0xa5, 0x64, 0x57, 0xdd, 0x1f, 0xee, 0xf1, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x9c, 0x9c, 0xf5, 0x4a, 0x7e, 0x03, 0x00, 0x00, +} + +func (m *OrderAsk) 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 *OrderAsk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OrderAsk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintWire(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x22 + } + if m.OwnerId != 0 { + i = encodeVarintWire(dAtA, i, uint64(m.OwnerId)) + i-- + dAtA[i] = 0x18 + } + if m.AskPrice != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.AskPrice)))) + i-- + dAtA[i] = 0x11 + } + if m.Quantity != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantity)))) + i-- + dAtA[i] = 0x9 + } + return len(dAtA) - i, nil +} + +func (m *OrderBid) 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 *OrderBid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintWire(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x22 + } + if m.OwnerId != 0 { + i = encodeVarintWire(dAtA, i, uint64(m.OwnerId)) + i-- + dAtA[i] = 0x18 + } + if m.MaxPrice != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MaxPrice)))) + i-- + dAtA[i] = 0x11 + } + if m.MaxQuantity != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MaxQuantity)))) + i-- + dAtA[i] = 0x9 + } + return len(dAtA) - i, nil +} + +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.SellersDenomination) > 0 { + i -= len(m.SellersDenomination) + copy(dAtA[i:], m.SellersDenomination) + i = encodeVarintWire(dAtA, i, uint64(len(m.SellersDenomination))) + i-- + dAtA[i] = 0x12 + } + if len(m.BuyersDenomination) > 0 { + i -= len(m.BuyersDenomination) + copy(dAtA[i:], m.BuyersDenomination) + i = encodeVarintWire(dAtA, i, uint64(len(m.BuyersDenomination))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Commodity) 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 *Commodity) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Commodity) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Quantity != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantity)))) + i-- + dAtA[i] = 0x11 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintWire(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Account) 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 *Account) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Commodities) > 0 { + for iNdEx := len(m.Commodities) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Commodities[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWire(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintWire(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if m.Index != 0 { + i = encodeVarintWire(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TradeSet) 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 *TradeSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TradeSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MatchedOrders) > 0 { + for iNdEx := len(m.MatchedOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MatchedOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWire(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Pair != nil { + { + size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWire(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MatchedOrder) 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 *MatchedOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MatchedOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OrderBid != nil { + { + size, err := m.OrderBid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWire(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.OrderAsk != nil { + { + size, err := m.OrderAsk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWire(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintWire(dAtA []byte, offset int, v uint64) int { + offset -= sovWire(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *OrderAsk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Quantity != 0 { + n += 9 + } + if m.AskPrice != 0 { + n += 9 + } + if m.OwnerId != 0 { + n += 1 + sovWire(uint64(m.OwnerId)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovWire(uint64(l)) + } + return n +} + +func (m *OrderBid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxQuantity != 0 { + n += 9 + } + if m.MaxPrice != 0 { + n += 9 + } + if m.OwnerId != 0 { + n += 1 + sovWire(uint64(m.OwnerId)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovWire(uint64(l)) + } + return n +} + +func (m *Pair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BuyersDenomination) + if l > 0 { + n += 1 + l + sovWire(uint64(l)) + } + l = len(m.SellersDenomination) + if l > 0 { + n += 1 + l + sovWire(uint64(l)) + } + return n +} + +func (m *Commodity) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovWire(uint64(l)) + } + if m.Quantity != 0 { + n += 9 + } + return n +} + +func (m *Account) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovWire(uint64(m.Index)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovWire(uint64(l)) + } + if len(m.Commodities) > 0 { + for _, e := range m.Commodities { + l = e.Size() + n += 1 + l + sovWire(uint64(l)) + } + } + return n +} + +func (m *TradeSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pair != nil { + l = m.Pair.Size() + n += 1 + l + sovWire(uint64(l)) + } + if len(m.MatchedOrders) > 0 { + for _, e := range m.MatchedOrders { + l = e.Size() + n += 1 + l + sovWire(uint64(l)) + } + } + return n +} + +func (m *MatchedOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OrderAsk != nil { + l = m.OrderAsk.Size() + n += 1 + l + sovWire(uint64(l)) + } + if m.OrderBid != nil { + l = m.OrderBid.Size() + n += 1 + l + sovWire(uint64(l)) + } + return n +} + +func sovWire(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozWire(x uint64) (n int) { + return sovWire(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *OrderAsk) 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 ErrIntOverflowWire + } + 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: OrderAsk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OrderAsk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Quantity = float64(math.Float64frombits(v)) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field AskPrice", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.AskPrice = float64(math.Float64frombits(v)) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerId", wireType) + } + m.OwnerId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OwnerId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWire(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWire + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OrderBid) 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 ErrIntOverflowWire + } + 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: OrderBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OrderBid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxQuantity", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.MaxQuantity = float64(math.Float64frombits(v)) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.MaxPrice = float64(math.Float64frombits(v)) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerId", wireType) + } + m.OwnerId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OwnerId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWire(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWire + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +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 ErrIntOverflowWire + } + 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 BuyersDenomination", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BuyersDenomination = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellersDenomination", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SellersDenomination = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWire(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWire + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Commodity) 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 ErrIntOverflowWire + } + 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: Commodity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Commodity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Quantity = float64(math.Float64frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipWire(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWire + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Account) 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 ErrIntOverflowWire + } + 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: Account: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commodities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Commodities = append(m.Commodities, &Commodity{}) + if err := m.Commodities[len(m.Commodities)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWire(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWire + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TradeSet) 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 ErrIntOverflowWire + } + 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: TradeSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TradeSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pair == nil { + m.Pair = &Pair{} + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MatchedOrders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MatchedOrders = append(m.MatchedOrders, &MatchedOrder{}) + if err := m.MatchedOrders[len(m.MatchedOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWire(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWire + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MatchedOrder) 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 ErrIntOverflowWire + } + 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: MatchedOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MatchedOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderAsk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OrderAsk == nil { + m.OrderAsk = &OrderAsk{} + } + if err := m.OrderAsk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderBid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWire + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWire + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWire + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OrderBid == nil { + m.OrderBid = &OrderBid{} + } + if err := m.OrderBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWire(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWire + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipWire(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, ErrIntOverflowWire + } + 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, ErrIntOverflowWire + } + 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, ErrIntOverflowWire + } + 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, ErrInvalidLengthWire + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupWire + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthWire + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF } var ( - file_wire_proto_rawDescOnce sync.Once - file_wire_proto_rawDescData = file_wire_proto_rawDesc + ErrInvalidLengthWire = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowWire = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupWire = fmt.Errorf("proto: unexpected end of group") ) - -func file_wire_proto_rawDescGZIP() []byte { - file_wire_proto_rawDescOnce.Do(func() { - file_wire_proto_rawDescData = protoimpl.X.CompressGZIP(file_wire_proto_rawDescData) - }) - return file_wire_proto_rawDescData -} - -var file_wire_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_wire_proto_goTypes = []interface{}{ - (*OrderAsk)(nil), // 0: orderbook.OrderAsk - (*OrderBid)(nil), // 1: orderbook.OrderBid - (*Pair)(nil), // 2: orderbook.Pair - (*Commodity)(nil), // 3: orderbook.Commodity - (*Account)(nil), // 4: orderbook.Account - (*TradeSet)(nil), // 5: orderbook.TradeSet - (*MatchedOrder)(nil), // 6: orderbook.MatchedOrder -} -var file_wire_proto_depIdxs = []int32{ - 3, // 0: orderbook.Account.commodities:type_name -> orderbook.Commodity - 2, // 1: orderbook.TradeSet.pair:type_name -> orderbook.Pair - 6, // 2: orderbook.TradeSet.matched_orders:type_name -> orderbook.MatchedOrder - 0, // 3: orderbook.MatchedOrder.order_ask:type_name -> orderbook.OrderAsk - 1, // 4: orderbook.MatchedOrder.order_bid:type_name -> orderbook.OrderBid - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_wire_proto_init() } -func file_wire_proto_init() { - if File_wire_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_wire_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderAsk); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wire_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderBid); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wire_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Pair); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wire_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Commodity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wire_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wire_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TradeSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wire_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MatchedOrder); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wire_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wire_proto_goTypes, - DependencyIndexes: file_wire_proto_depIdxs, - MessageInfos: file_wire_proto_msgTypes, - }.Build() - File_wire_proto = out.File - file_wire_proto_rawDesc = nil - file_wire_proto_goTypes = nil - file_wire_proto_depIdxs = nil -} diff --git a/proto/tendermint/crypto/keys.pb.go b/proto/tendermint/crypto/keys.pb.go index bbd97d446..cfd176c6e 100644 --- a/proto/tendermint/crypto/keys.pb.go +++ b/proto/tendermint/crypto/keys.pb.go @@ -27,6 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PublicKey defines the keys available for use with Tendermint Validators type PublicKey struct { // Types that are valid to be assigned to Sum: + // // *PublicKey_Ed25519 // *PublicKey_Secp256K1 Sum isPublicKey_Sum `protobuf_oneof:"sum"` diff --git a/proto/tendermint/mempool/types.pb.go b/proto/tendermint/mempool/types.pb.go index f7d16a64c..e63d67611 100644 --- a/proto/tendermint/mempool/types.pb.go +++ b/proto/tendermint/mempool/types.pb.go @@ -68,6 +68,7 @@ func (m *Txs) GetTxs() [][]byte { type Message struct { // Types that are valid to be assigned to Sum: + // // *Message_Txs Sum isMessage_Sum `protobuf_oneof:"sum"` } diff --git a/proto/tendermint/p2p/conn.pb.go b/proto/tendermint/p2p/conn.pb.go index dccdbe4a0..b2ace8eb8 100644 --- a/proto/tendermint/p2p/conn.pb.go +++ b/proto/tendermint/p2p/conn.pb.go @@ -158,6 +158,7 @@ func (m *PacketMsg) GetData() []byte { type Packet struct { // Types that are valid to be assigned to Sum: + // // *Packet_PacketPing // *Packet_PacketPong // *Packet_PacketMsg diff --git a/proto/tendermint/statesync/types.pb.go b/proto/tendermint/statesync/types.pb.go index 147e0f7d4..9ec4a1f36 100644 --- a/proto/tendermint/statesync/types.pb.go +++ b/proto/tendermint/statesync/types.pb.go @@ -24,6 +24,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Message struct { // Types that are valid to be assigned to Sum: + // // *Message_SnapshotsRequest // *Message_SnapshotsResponse // *Message_ChunkRequest