diff --git a/abci/example/orderbook/app.go b/abci/example/orderbook/app.go index 08a4780f8..ae9d88572 100644 --- a/abci/example/orderbook/app.go +++ b/abci/example/orderbook/app.go @@ -21,11 +21,10 @@ type StateMachine struct { db dbm.DB // in-memory state - accounts map[uint64]*Account - commodities map[uint64]*Commodity - + accounts map[uint64]*Account + commodities map[string]*Commodity // app-side mempool - markets map[string]*Market // i.e. ATOM/USDC + markets map[string]*Market // i.e. ATOM/USDC } func New() *StateMachine { @@ -62,30 +61,52 @@ func (sm *StateMachine) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx } //check there is no other account with the same public key - case *Msg_MsgPlaceOrder: + case *Msg_MsgBid: - if err := m.MsgPlaceOrder.ValidateBasic(); err != nil { + if err := m.MsgBid.ValidateBasic(); err != nil { return types.ResponseCheckTx{Code: 3, Log: err.Error()} } // check if account exists - if _, ok := sm.accounts[m.MsgPlaceOrder.Order.Owner]; !ok { + if _, ok := sm.accounts[m.MsgBid.Order.Owner.Index]; !ok { return types.ResponseCheckTx{Code: 4} } - + // check the commodity exists - if _, ok := sm.commodities[m.MsgPlaceOrder.Order.QuantityOutbound]; !ok { + if _, ok := sm.commodities[m.MsgBid.Pair.OutboundCommodityDenom]; !ok { return types.ResponseCheckTx{Code: 4} } + // check if pair is registered + if _, ok := sm.markets[m.MsgBid.Pair.String()]; !ok { + return types.ResponseCheckTx{Code: 4} + } + + case *Msg_MsgAsk: + + if err := m.MsgAsk.ValidateBasic(); err != nil { + return types.ResponseCheckTx{Code: 3, Log: err.Error()} + } + + // check if account exists + if _, ok := sm.accounts[m.MsgAsk.Order.Owner.Index]; !ok { + return types.ResponseCheckTx{Code: 4} + } + + // check the commodity exists + if _, ok := sm.commodities[m.MsgAsk.Pair.OutboundCommodityDenom]; !ok { + return types.ResponseCheckTx{Code: 4} + } + + // check if pair is registered + if _, ok := sm.markets[m.MsgAsk.Pair.String()]; !ok { + return types.ResponseCheckTx{Code: 4} + + } + // check the commodity has a high enough quantity - if err := sm.commodities[m.MsgPlaceOrder.Pair].Quantity >= m.MsgPlaceOrder.Order.QuantityOutbound; !ok { - - } - - // check if pair is registered - if _, ok := sm.markets[m.MsgPlaceOrder.Pair.String()]; !ok { - return types.ResponseCheckTx{Code: 4} + if err := m.MsgAsk.Quantity >= sm.commodities[m.MsgAsk.Pair.OutboundCommodityDenom].Quantity; !ok { + return types.ResponseCheckTx{Code: 4, Log: err.Error()} } default: @@ -149,7 +170,7 @@ func (sm *StateMachine) ProcessProposal(req types.RequestProcessProposal) types. Status: types.ResponseProcessProposal_ACCEPT} } -func (msg *MsgPlaceOrder) ValidateBasic() error { +func (msg *MsgBid) ValidateBasic() error { if err := msg.Order.ValidateBasic(); err != nil { return err } @@ -162,6 +183,29 @@ func (msg *MsgPlaceOrder) ValidateBasic() error { return errors.New("invalid signature size") } + //quantity to be more than 0 + // price to not be 0 + + return nil +} + +func (msg *MsgAsk) ValidateBasic() error { + if err := msg.Order.ValidateBasic(); err != nil { + return err + } + + if err := msg.Pair.ValidateBasic(); err != nil { + return err + } + + if len(msg.Signature) != ed25519.SignatureSize { + return errors.New("invalid signature size") + } + + + //quantity to be more than 0 + // price to not be 0 + return nil } @@ -190,7 +234,7 @@ func (msg *MsgRegisterPair) ValidateBasic() error { } func (c *Commodity) ValidateBasic() error { - if c.Quantity <= 0 { + if c.Quantity <= 0 { return errors.New("quantity must be greater than zero") } } @@ -207,12 +251,24 @@ func (p *Pair) ValidateBasic() error { return nil } -func (o *Order) ValidateBasic() error { - if o.QuantityOutbound == 0 { +func (o *OrderBid) ValidateBasic() error { + if o.Quantity == 0 { return errors.New("quantity outbound must be non zero") } - if o.MinPrice <= 0 { + if o.MaxPrice <= 0 { + return errors.New("min price must be greater than 0") + } + + return nil +} + +func (o *OrderAsk) ValidateBasic() error { + if o.Quantity == 0 { + return errors.New("quantity outbound must be non zero") + } + + if o.AskPrice <= 0 { return errors.New("min price must be greater than 0") } diff --git a/abci/example/orderbook/msgs.pb.go b/abci/example/orderbook/msgs.pb.go index 89e949218..b2e5e7c50 100644 --- a/abci/example/orderbook/msgs.pb.go +++ b/abci/example/orderbook/msgs.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.18.1 +// protoc v3.21.7 // source: msgs.proto package orderbook @@ -25,11 +25,24 @@ type MsgBid struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields +<<<<<<< Updated upstream Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` MaxPrice float64 `protobuf:"fixed64,2,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` Quantity uint64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` AccountId uint64 `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` Signature [][]byte `protobuf:"bytes,5,rep,name=signature,proto3" json:"signature,omitempty"` +||||||| constructed merge base + Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` + Order *Order `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` + Signature [][]byte `protobuf:"bytes,3,rep,name=signature,proto3" json:"signature,omitempty"` +======= + Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` + MaxPrice uint64 `protobuf:"varint,2,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` + Quantity uint64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + AccountId uint64 `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Signature [][]byte `protobuf:"bytes,5,rep,name=signature,proto3" json:"signature,omitempty"` + Order *OrderBid `protobuf:"bytes,6,opt,name=order,proto3" json:"order,omitempty"` +>>>>>>> Stashed changes } func (x *MsgBid) Reset() { @@ -71,7 +84,12 @@ func (x *MsgBid) GetPair() *Pair { return nil } +<<<<<<< Updated upstream func (x *MsgBid) GetMaxPrice() float64 { +||||||| constructed merge base +func (x *MsgPlaceOrder) GetOrder() *Order { +======= +func (x *MsgBid) GetMaxPrice() uint64 { if x != nil { return x.MaxPrice } @@ -99,6 +117,36 @@ func (x *MsgBid) GetSignature() [][]byte { return nil } +func (x *MsgBid) GetOrder() *OrderBid { +>>>>>>> Stashed changes + if x != nil { + return x.MaxPrice + } + return 0 +} + +func (x *MsgBid) GetQuantity() uint64 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *MsgBid) GetAccountId() uint64 { + if x != nil { + return x.AccountId + } + return 0 +} + +func (x *MsgBid) GetSignature() [][]byte { + if x != nil { + return x.Signature + } + return nil +} + +<<<<<<< Updated upstream type MsgAsk struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -172,12 +220,97 @@ func (x *MsgAsk) GetAccountId() uint64 { } func (x *MsgAsk) GetSignature() [][]byte { +||||||| constructed merge base +func (x *MsgPlaceOrder) GetSignature() [][]byte { +======= +type MsgAsk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` + MinPrice uint64 `protobuf:"varint,2,opt,name=min_price,json=minPrice,proto3" json:"min_price,omitempty"` + Quantity uint64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + AccountId uint64 `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Signature [][]byte `protobuf:"bytes,5,rep,name=signature,proto3" json:"signature,omitempty"` + Order *OrderAsk `protobuf:"bytes,6,opt,name=order,proto3" json:"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 (*MsgAsk) Descriptor() ([]byte, []int) { + return file_msgs_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgAsk) GetPair() *Pair { + if x != nil { + return x.Pair + } + return nil +} + +func (x *MsgAsk) GetMinPrice() uint64 { + if x != nil { + return x.MinPrice + } + return 0 +} + +func (x *MsgAsk) GetQuantity() uint64 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *MsgAsk) GetAccountId() uint64 { + if x != nil { + return x.AccountId + } + return 0 +} + +func (x *MsgAsk) GetSignature() [][]byte { +>>>>>>> Stashed changes if x != nil { return x.Signature } return nil } +func (x *MsgAsk) GetOrder() *OrderAsk { + if x != nil { + return x.Order + } + return nil +} + type MsgCreateAccount struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -288,8 +421,15 @@ type Msg struct { //a Msg has to be one of the below // // Types that are assignable to Sum: +<<<<<<< Updated upstream // *Msg_MsgBid // *Msg_MsgAsk +||||||| constructed merge base + // *Msg_MsgPlaceOrder +======= + // *Msg_MsgAsk + // *Msg_MsgBid +>>>>>>> Stashed changes // *Msg_MsgRegisterPair // *Msg_MsgCreateAccount Sum isMsg_Sum `protobuf_oneof:"sum"` @@ -334,6 +474,7 @@ func (m *Msg) GetSum() isMsg_Sum { return nil } +<<<<<<< Updated upstream func (x *Msg) GetMsgBid() *MsgBid { if x, ok := x.GetSum().(*Msg_MsgBid); ok { return x.MsgBid @@ -344,6 +485,22 @@ func (x *Msg) GetMsgBid() *MsgBid { func (x *Msg) GetMsgAsk() *MsgAsk { if x, ok := x.GetSum().(*Msg_MsgAsk); ok { return x.MsgAsk +||||||| constructed merge base +func (x *Msg) GetMsgPlaceOrder() *MsgPlaceOrder { + if x, ok := x.GetSum().(*Msg_MsgPlaceOrder); ok { + return x.MsgPlaceOrder +======= +func (x *Msg) GetMsgAsk() *MsgAsk { + if x, ok := x.GetSum().(*Msg_MsgAsk); ok { + return x.MsgAsk + } + return nil +} + +func (x *Msg) GetMsgBid() *MsgBid { + if x, ok := x.GetSum().(*Msg_MsgBid); ok { + return x.MsgBid +>>>>>>> Stashed changes } return nil } @@ -366,12 +523,24 @@ type isMsg_Sum interface { isMsg_Sum() } +<<<<<<< Updated upstream 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"` +||||||| constructed merge base +type Msg_MsgPlaceOrder struct { + MsgPlaceOrder *MsgPlaceOrder `protobuf:"bytes,1,opt,name=msg_place_order,json=msgPlaceOrder,proto3,oneof"` +======= +type Msg_MsgAsk struct { + MsgAsk *MsgAsk `protobuf:"bytes,1,opt,name=msg_ask,json=msgAsk,proto3,oneof"` +} + +type Msg_MsgBid struct { + MsgBid *MsgBid `protobuf:"bytes,2,opt,name=msg_bid,json=msgBid,proto3,oneof"` +>>>>>>> Stashed changes } type Msg_MsgRegisterPair struct { @@ -382,9 +551,17 @@ type Msg_MsgCreateAccount struct { MsgCreateAccount *MsgCreateAccount `protobuf:"bytes,4,opt,name=msg_create_account,json=msgCreateAccount,proto3,oneof"` } +<<<<<<< Updated upstream func (*Msg_MsgBid) isMsg_Sum() {} func (*Msg_MsgAsk) isMsg_Sum() {} +||||||| constructed merge base +func (*Msg_MsgPlaceOrder) isMsg_Sum() {} +======= +func (*Msg_MsgAsk) isMsg_Sum() {} + +func (*Msg_MsgBid) isMsg_Sum() {} +>>>>>>> Stashed changes func (*Msg_MsgRegisterPair) isMsg_Sum() {} @@ -395,6 +572,7 @@ 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, +<<<<<<< Updated upstream 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x01, 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, @@ -446,6 +624,103 @@ var file_msgs_proto_rawDesc = []byte{ 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, +||||||| constructed merge base + 0x6f, 0x74, 0x6f, 0x22, 0x7a, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, + 0x72, 0x64, 0x65, 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, 0x12, 0x26, 0x0a, 0x05, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 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, 0x03, 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, 0xe7, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x42, 0x0a, 0x0f, 0x6d, 0x73, + 0x67, 0x5f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, + 0x4d, 0x73, 0x67, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, + 0x0d, 0x6d, 0x73, 0x67, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x48, + 0x0a, 0x11, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, + 0x61, 0x69, 0x72, 0x18, 0x02, 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, 0x03, + 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, 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, +======= + 0x6f, 0x74, 0x6f, 0x22, 0xce, 0x01, 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, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x18, 0x06, 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, 0x05, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x22, 0xce, 0x01, 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, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, + 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x18, 0x06, 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, 0x05, + 0x6f, 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, 0x03, 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, 0xff, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, + 0x12, 0x2c, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x5f, 0x61, 0x73, 0x6b, 0x18, 0x01, 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, 0x2c, + 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x02, 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, 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, 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, +>>>>>>> Stashed changes } var ( @@ -462,6 +737,7 @@ func file_msgs_proto_rawDescGZIP() []byte { var file_msgs_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_msgs_proto_goTypes = []interface{}{ +<<<<<<< Updated upstream (*MsgBid)(nil), // 0: orderbook.MsgBid (*MsgAsk)(nil), // 1: orderbook.MsgAsk (*MsgCreateAccount)(nil), // 2: orderbook.MsgCreateAccount @@ -469,8 +745,28 @@ var file_msgs_proto_goTypes = []interface{}{ (*Msg)(nil), // 4: orderbook.Msg (*Pair)(nil), // 5: orderbook.Pair (*Commodity)(nil), // 6: orderbook.Commodity +||||||| constructed merge base + (*MsgPlaceOrder)(nil), // 0: orderbook.MsgPlaceOrder + (*MsgCreateAccount)(nil), // 1: orderbook.MsgCreateAccount + (*MsgRegisterPair)(nil), // 2: orderbook.MsgRegisterPair + (*Msg)(nil), // 3: orderbook.Msg + (*Pair)(nil), // 4: orderbook.Pair + (*Order)(nil), // 5: orderbook.Order + (*Commodity)(nil), // 6: orderbook.Commodity +======= + (*MsgBid)(nil), // 0: orderbook.MsgBid + (*MsgAsk)(nil), // 1: orderbook.MsgAsk + (*MsgCreateAccount)(nil), // 2: orderbook.MsgCreateAccount + (*MsgRegisterPair)(nil), // 3: orderbook.MsgRegisterPair + (*Msg)(nil), // 4: orderbook.Msg + (*Pair)(nil), // 5: orderbook.Pair + (*OrderBid)(nil), // 6: orderbook.OrderBid + (*OrderAsk)(nil), // 7: orderbook.OrderAsk + (*Commodity)(nil), // 8: orderbook.Commodity +>>>>>>> Stashed changes } var file_msgs_proto_depIdxs = []int32{ +<<<<<<< Updated upstream 5, // 0: orderbook.MsgBid.pair:type_name -> orderbook.Pair 5, // 1: orderbook.MsgAsk.pair:type_name -> orderbook.Pair 6, // 2: orderbook.MsgCreateAccount.commodities:type_name -> orderbook.Commodity @@ -484,6 +780,36 @@ var file_msgs_proto_depIdxs = []int32{ 8, // [8:8] is the sub-list for extension type_name 8, // [8:8] is the sub-list for extension extendee 0, // [0:8] is the sub-list for field type_name +||||||| constructed merge base + 4, // 0: orderbook.MsgPlaceOrder.pair:type_name -> orderbook.Pair + 5, // 1: orderbook.MsgPlaceOrder.order:type_name -> orderbook.Order + 6, // 2: orderbook.MsgCreateAccount.commodities:type_name -> orderbook.Commodity + 4, // 3: orderbook.MsgRegisterPair.pair:type_name -> orderbook.Pair + 0, // 4: orderbook.Msg.msg_place_order:type_name -> orderbook.MsgPlaceOrder + 2, // 5: orderbook.Msg.msg_register_pair:type_name -> orderbook.MsgRegisterPair + 1, // 6: orderbook.Msg.msg_create_account:type_name -> orderbook.MsgCreateAccount + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +======= + 5, // 0: orderbook.MsgBid.pair:type_name -> orderbook.Pair + 6, // 1: orderbook.MsgBid.order:type_name -> orderbook.OrderBid + 5, // 2: orderbook.MsgAsk.pair:type_name -> orderbook.Pair + 7, // 3: orderbook.MsgAsk.order:type_name -> orderbook.OrderAsk + 8, // 4: orderbook.MsgCreateAccount.commodities:type_name -> orderbook.Commodity + 5, // 5: orderbook.MsgRegisterPair.pair:type_name -> orderbook.Pair + 1, // 6: orderbook.Msg.msg_ask:type_name -> orderbook.MsgAsk + 0, // 7: orderbook.Msg.msg_bid:type_name -> orderbook.MsgBid + 3, // 8: orderbook.Msg.msg_register_pair:type_name -> orderbook.MsgRegisterPair + 2, // 9: orderbook.Msg.msg_create_account:type_name -> orderbook.MsgCreateAccount + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +>>>>>>> Stashed changes } func init() { file_msgs_proto_init() } @@ -554,9 +880,18 @@ func file_msgs_proto_init() { } } } +<<<<<<< Updated upstream file_msgs_proto_msgTypes[4].OneofWrappers = []interface{}{ (*Msg_MsgBid)(nil), (*Msg_MsgAsk)(nil), +||||||| constructed merge base + file_msgs_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*Msg_MsgPlaceOrder)(nil), +======= + file_msgs_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*Msg_MsgAsk)(nil), + (*Msg_MsgBid)(nil), +>>>>>>> Stashed changes (*Msg_MsgRegisterPair)(nil), (*Msg_MsgCreateAccount)(nil), } diff --git a/abci/example/orderbook/msgs.proto b/abci/example/orderbook/msgs.proto index 03e1e2a2a..43e3db013 100644 --- a/abci/example/orderbook/msgs.proto +++ b/abci/example/orderbook/msgs.proto @@ -11,14 +11,16 @@ message MsgBid { uint64 quantity = 3; uint64 account_id = 4; repeated bytes signature = 5; + OrderBid order = 6; } message MsgAsk { Pair pair = 1; - double price = 2; + double min_price = 2; uint64 quantity = 3; uint64 account_id = 4; repeated bytes signature = 5; + OrderAsk order = 6; } message MsgCreateAccount { diff --git a/abci/example/orderbook/wire.pb.go b/abci/example/orderbook/wire.pb.go index 3a2f7abb1..08eb7d4a9 100644 --- a/abci/example/orderbook/wire.pb.go +++ b/abci/example/orderbook/wire.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.18.1 +// protoc v3.21.7 // source: wire.proto package orderbook @@ -20,19 +20,43 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +<<<<<<< Updated upstream type Pair struct { +||||||| constructed merge base +type Order struct { +======= +type OrderAsk struct { +>>>>>>> Stashed changes state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields +<<<<<<< Updated upstream // 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"` +||||||| constructed merge base + QuantityOutbound uint64 `protobuf:"varint,1,opt,name=quantity_outbound,json=quantityOutbound,proto3" json:"quantity_outbound,omitempty"` + MinPrice float64 `protobuf:"fixed64,2,opt,name=min_price,json=minPrice,proto3" json:"min_price,omitempty"` + Owner uint64 `protobuf:"varint,3,opt,name=owner,proto3" json:"owner,omitempty"` +======= + Quantity uint64 `protobuf:"varint,1,opt,name=quantity,proto3" json:"quantity,omitempty"` + AskPrice uint64 `protobuf:"varint,2,opt,name=ask_price,json=askPrice,proto3" json:"ask_price,omitempty"` + Owner *Account `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` +>>>>>>> Stashed changes } +<<<<<<< Updated upstream func (x *Pair) Reset() { *x = Pair{} +||||||| constructed merge base +func (x *Order) Reset() { + *x = Order{} +======= +func (x *OrderAsk) Reset() { + *x = OrderAsk{} +>>>>>>> Stashed changes if protoimpl.UnsafeEnabled { mi := &file_wire_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -40,13 +64,31 @@ func (x *Pair) Reset() { } } +<<<<<<< Updated upstream func (x *Pair) String() string { +||||||| constructed merge base +func (x *Order) String() string { +======= +func (x *OrderAsk) String() string { +>>>>>>> Stashed changes return protoimpl.X.MessageStringOf(x) } +<<<<<<< Updated upstream func (*Pair) ProtoMessage() {} +||||||| constructed merge base +func (*Order) ProtoMessage() {} +======= +func (*OrderAsk) ProtoMessage() {} +>>>>>>> Stashed changes +<<<<<<< Updated upstream func (x *Pair) ProtoReflect() protoreflect.Message { +||||||| constructed merge base +func (x *Order) ProtoReflect() protoreflect.Message { +======= +func (x *OrderAsk) ProtoReflect() protoreflect.Message { +>>>>>>> Stashed changes mi := &file_wire_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -58,36 +100,88 @@ func (x *Pair) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +<<<<<<< Updated upstream // Deprecated: Use Pair.ProtoReflect.Descriptor instead. func (*Pair) Descriptor() ([]byte, []int) { +||||||| constructed merge base +// Deprecated: Use Order.ProtoReflect.Descriptor instead. +func (*Order) Descriptor() ([]byte, []int) { +======= +// Deprecated: Use OrderAsk.ProtoReflect.Descriptor instead. +func (*OrderAsk) Descriptor() ([]byte, []int) { +>>>>>>> Stashed changes return file_wire_proto_rawDescGZIP(), []int{0} } +<<<<<<< Updated upstream func (x *Pair) GetBuyersDenomination() string { +||||||| constructed merge base +func (x *Order) GetQuantityOutbound() uint64 { +======= +func (x *OrderAsk) GetQuantity() uint64 { +>>>>>>> Stashed changes if x != nil { +<<<<<<< Updated upstream return x.BuyersDenomination +||||||| constructed merge base + return x.QuantityOutbound +======= + return x.Quantity +>>>>>>> Stashed changes } +<<<<<<< Updated upstream return "" +||||||| constructed merge base + return 0 } +func (x *Order) GetMinPrice() float64 { + if x != nil { + return x.MinPrice + } + return 0 +======= + return 0 +} + +func (x *OrderAsk) GetAskPrice() uint64 { + if x != nil { + return x.AskPrice + } + return 0 +>>>>>>> Stashed changes +} + +<<<<<<< Updated upstream func (x *Pair) GetSellersDenomination() string { +||||||| constructed merge base +func (x *Order) GetOwner() uint64 { +======= +func (x *OrderAsk) GetOwner() *Account { +>>>>>>> Stashed changes if x != nil { return x.SellersDenomination } +<<<<<<< Updated upstream return "" +||||||| constructed merge base + return 0 +======= + return nil } -type Commodity struct { +type OrderBid struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Quantity uint64 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` + Quantity uint64 `protobuf:"varint,1,opt,name=quantity,proto3" json:"quantity,omitempty"` + MaxPrice uint64 `protobuf:"varint,2,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` + Owner *Account `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` } -func (x *Commodity) Reset() { - *x = Commodity{} +func (x *OrderBid) Reset() { + *x = OrderBid{} if protoimpl.UnsafeEnabled { mi := &file_wire_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -95,13 +189,13 @@ func (x *Commodity) Reset() { } } -func (x *Commodity) String() string { +func (x *OrderBid) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Commodity) ProtoMessage() {} +func (*OrderBid) ProtoMessage() {} -func (x *Commodity) ProtoReflect() protoreflect.Message { +func (x *OrderBid) ProtoReflect() protoreflect.Message { mi := &file_wire_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -113,9 +207,96 @@ func (x *Commodity) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use OrderBid.ProtoReflect.Descriptor instead. +func (*OrderBid) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{1} +} + +func (x *OrderBid) GetQuantity() uint64 { + if x != nil { + return x.Quantity + } + return 0 +>>>>>>> Stashed changes +} + +<<<<<<< Updated upstream +type Commodity struct { +||||||| constructed merge base +type Pair struct { +======= +func (x *OrderBid) GetMaxPrice() uint64 { + if x != nil { + return x.MaxPrice + } + return 0 +} + +func (x *OrderBid) GetOwner() *Account { + if x != nil { + return x.Owner + } + return nil +} + +type Pair struct { +>>>>>>> Stashed changes + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Quantity uint64 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` +} + +func (x *Commodity) Reset() { + *x = Commodity{} + if protoimpl.UnsafeEnabled { + mi := &file_wire_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Commodity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Commodity) ProtoMessage() {} + +<<<<<<< Updated upstream +func (x *Commodity) ProtoReflect() protoreflect.Message { + mi := &file_wire_proto_msgTypes[1] +||||||| constructed merge base +func (x *Pair) ProtoReflect() protoreflect.Message { + mi := &file_wire_proto_msgTypes[1] +======= +func (x *Pair) ProtoReflect() protoreflect.Message { + mi := &file_wire_proto_msgTypes[2] +>>>>>>> Stashed changes + 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) +} + +<<<<<<< Updated upstream // Deprecated: Use Commodity.ProtoReflect.Descriptor instead. func (*Commodity) Descriptor() ([]byte, []int) { return file_wire_proto_rawDescGZIP(), []int{1} +||||||| constructed merge base +// Deprecated: Use Pair.ProtoReflect.Descriptor instead. +func (*Pair) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{1} +======= +// Deprecated: Use Pair.ProtoReflect.Descriptor instead. +func (*Pair) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{2} +>>>>>>> Stashed changes } func (x *Commodity) GetDenom() string { @@ -146,7 +327,7 @@ type Account struct { func (x *Account) Reset() { *x = Account{} if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[2] + mi := &file_wire_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -158,8 +339,16 @@ func (x *Account) String() string { func (*Account) ProtoMessage() {} +<<<<<<< Updated upstream func (x *Account) ProtoReflect() protoreflect.Message { mi := &file_wire_proto_msgTypes[2] +||||||| constructed merge base +func (x *Commodity) ProtoReflect() protoreflect.Message { + mi := &file_wire_proto_msgTypes[2] +======= +func (x *Commodity) ProtoReflect() protoreflect.Message { + mi := &file_wire_proto_msgTypes[3] +>>>>>>> Stashed changes if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -170,9 +359,19 @@ func (x *Account) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +<<<<<<< Updated upstream // Deprecated: Use Account.ProtoReflect.Descriptor instead. func (*Account) Descriptor() ([]byte, []int) { return file_wire_proto_rawDescGZIP(), []int{2} +||||||| constructed merge base +// Deprecated: Use Commodity.ProtoReflect.Descriptor instead. +func (*Commodity) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{2} +======= +// Deprecated: Use Commodity.ProtoReflect.Descriptor instead. +func (*Commodity) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{3} +>>>>>>> Stashed changes } func (x *Account) GetIndex() uint64 { @@ -211,7 +410,7 @@ type TradeSet struct { func (x *TradeSet) Reset() { *x = TradeSet{} if protoimpl.UnsafeEnabled { - mi := &file_wire_proto_msgTypes[3] + mi := &file_wire_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -223,8 +422,16 @@ func (x *TradeSet) String() string { func (*TradeSet) ProtoMessage() {} +<<<<<<< Updated upstream func (x *TradeSet) ProtoReflect() protoreflect.Message { mi := &file_wire_proto_msgTypes[3] +||||||| constructed merge base +func (x *Account) ProtoReflect() protoreflect.Message { + mi := &file_wire_proto_msgTypes[3] +======= +func (x *Account) ProtoReflect() protoreflect.Message { + mi := &file_wire_proto_msgTypes[4] +>>>>>>> Stashed changes if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -235,9 +442,19 @@ func (x *TradeSet) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +<<<<<<< Updated upstream // Deprecated: Use TradeSet.ProtoReflect.Descriptor instead. func (*TradeSet) Descriptor() ([]byte, []int) { return file_wire_proto_rawDescGZIP(), []int{3} +||||||| constructed merge base +// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{3} +======= +// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{4} +>>>>>>> Stashed changes } func (x *TradeSet) GetPair() *Pair { @@ -355,10 +572,137 @@ func (x *MatchedOrder) GetSellerSignature() [][]byte { return nil } +type TradeSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` // ATOM/USDC + 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 (*TradeSet) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{5} +} + +func (x *TradeSet) GetPair() *Pair { + if x != nil { + return x.Pair + } + return nil +} + +func (x *TradeSet) GetMatchedOrders() []*MatchedOrder { + if x != nil { + return x.MatchedOrders + } + return nil +} + +type MatchedOrder struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BuyOrder *OrderBid `protobuf:"bytes,1,opt,name=buy_order,json=buyOrder,proto3" json:"buy_order,omitempty"` + BuyerSignature [][]byte `protobuf:"bytes,2,rep,name=buyer_signature,json=buyerSignature,proto3" json:"buyer_signature,omitempty"` + SellOrder *OrderAsk `protobuf:"bytes,3,opt,name=sell_order,json=sellOrder,proto3" json:"sell_order,omitempty"` + SellerSignature [][]byte `protobuf:"bytes,4,rep,name=seller_signature,json=sellerSignature,proto3" json:"seller_signature,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 (*MatchedOrder) Descriptor() ([]byte, []int) { + return file_wire_proto_rawDescGZIP(), []int{6} +} + +func (x *MatchedOrder) GetBuyOrder() *OrderBid { + if x != nil { + return x.BuyOrder + } + return nil +} + +func (x *MatchedOrder) GetBuyerSignature() [][]byte { + if x != nil { + return x.BuyerSignature + } + return nil +} + +func (x *MatchedOrder) GetSellOrder() *OrderAsk { + if x != nil { + return x.SellOrder + } + return nil +} + +func (x *MatchedOrder) GetSellerSignature() [][]byte { + if x != nil { + return x.SellerSignature + } + return nil +} + var File_wire_proto protoreflect.FileDescriptor var file_wire_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, +<<<<<<< Updated upstream 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 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, @@ -404,6 +748,98 @@ var file_wire_proto_rawDesc = []byte{ 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, +||||||| constructed merge base + 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x22, 0x67, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x12, 0x2b, 0x0a, 0x11, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x75, 0x74, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x71, 0x75, 0x61, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x22, 0x78, 0x0a, 0x04, 0x50, 0x61, 0x69, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x69, 0x6e, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x69, 0x6e, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, + 0x12, 0x38, 0x0a, 0x18, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x16, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x64, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 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, 0x04, 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, 0x03, 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, 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, +======= + 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x22, 0x6d, 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, 0x04, 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, 0x04, 0x52, 0x08, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x05, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x08, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, + 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x71, 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, + 0x04, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x05, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x78, 0x0a, 0x04, 0x50, 0x61, 0x69, 0x72, 0x12, 0x36, 0x0a, + 0x17, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, + 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, + 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x79, + 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x38, 0x0a, 0x18, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 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, 0x04, 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, + 0x03, 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, 0xc8, 0x01, 0x0a, 0x0c, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x09, 0x62, 0x75, 0x79, 0x5f, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 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, 0x75, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x62, 0x75, + 0x79, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x62, 0x75, 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x32, 0x0a, 0x0a, 0x73, 0x65, 0x6c, 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x18, 0x03, 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, 0x09, 0x73, 0x65, + 0x6c, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x6c, 0x6c, 0x65, + 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x0f, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 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, +>>>>>>> Stashed changes } var ( @@ -418,15 +854,37 @@ func file_wire_proto_rawDescGZIP() []byte { return file_wire_proto_rawDescData } +<<<<<<< Updated upstream var file_wire_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +||||||| constructed merge base +var file_wire_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +======= +var file_wire_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +>>>>>>> Stashed changes var file_wire_proto_goTypes = []interface{}{ +<<<<<<< Updated upstream (*Pair)(nil), // 0: orderbook.Pair (*Commodity)(nil), // 1: orderbook.Commodity (*Account)(nil), // 2: orderbook.Account (*TradeSet)(nil), // 3: orderbook.TradeSet (*MatchedOrder)(nil), // 4: orderbook.MatchedOrder +||||||| constructed merge base + (*Order)(nil), // 0: orderbook.Order + (*Pair)(nil), // 1: orderbook.Pair + (*Commodity)(nil), // 2: orderbook.Commodity + (*Account)(nil), // 3: orderbook.Account +======= + (*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 +>>>>>>> Stashed changes } var file_wire_proto_depIdxs = []int32{ +<<<<<<< Updated upstream 1, // 0: orderbook.Account.commodities:type_name -> orderbook.Commodity 0, // 1: orderbook.TradeSet.pair:type_name -> orderbook.Pair 4, // 2: orderbook.TradeSet.matched_orders:type_name -> orderbook.MatchedOrder @@ -435,6 +893,27 @@ var file_wire_proto_depIdxs = []int32{ 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name +||||||| constructed merge base + 2, // 0: orderbook.Account.commodities:type_name -> orderbook.Commodity + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +======= + 4, // 0: orderbook.OrderAsk.owner:type_name -> orderbook.Account + 4, // 1: orderbook.OrderBid.owner:type_name -> orderbook.Account + 3, // 2: orderbook.Account.commodities:type_name -> orderbook.Commodity + 2, // 3: orderbook.TradeSet.pair:type_name -> orderbook.Pair + 6, // 4: orderbook.TradeSet.matched_orders:type_name -> orderbook.MatchedOrder + 1, // 5: orderbook.MatchedOrder.buy_order:type_name -> orderbook.OrderBid + 0, // 6: orderbook.MatchedOrder.sell_order:type_name -> orderbook.OrderAsk + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +>>>>>>> Stashed changes } func init() { file_wire_proto_init() } @@ -444,7 +923,13 @@ func file_wire_proto_init() { } if !protoimpl.UnsafeEnabled { file_wire_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { +<<<<<<< Updated upstream switch v := v.(*Pair); i { +||||||| constructed merge base + switch v := v.(*Order); i { +======= + switch v := v.(*OrderAsk); i { +>>>>>>> Stashed changes case 0: return &v.state case 1: @@ -456,7 +941,13 @@ func file_wire_proto_init() { } } file_wire_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { +<<<<<<< Updated upstream switch v := v.(*Commodity); i { +||||||| constructed merge base + switch v := v.(*Pair); i { +======= + switch v := v.(*OrderBid); i { +>>>>>>> Stashed changes case 0: return &v.state case 1: @@ -468,7 +959,13 @@ func file_wire_proto_init() { } } file_wire_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { +<<<<<<< Updated upstream switch v := v.(*Account); i { +||||||| constructed merge base + switch v := v.(*Commodity); i { +======= + switch v := v.(*Pair); i { +>>>>>>> Stashed changes case 0: return &v.state case 1: @@ -480,6 +977,7 @@ func file_wire_proto_init() { } } file_wire_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { +<<<<<<< Updated upstream switch v := v.(*TradeSet); i { case 0: return &v.state @@ -493,6 +991,47 @@ func file_wire_proto_init() { } file_wire_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MatchedOrder); i { +||||||| constructed merge base + switch v := v.(*Account); i { +======= + 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 { +>>>>>>> Stashed changes + 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: @@ -510,7 +1049,13 @@ func file_wire_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_wire_proto_rawDesc, NumEnums: 0, +<<<<<<< Updated upstream NumMessages: 5, +||||||| constructed merge base + NumMessages: 4, +======= + NumMessages: 7, +>>>>>>> Stashed changes NumExtensions: 0, NumServices: 0, }, diff --git a/abci/example/orderbook/wire.proto b/abci/example/orderbook/wire.proto index 53948d633..07b032571 100644 --- a/abci/example/orderbook/wire.proto +++ b/abci/example/orderbook/wire.proto @@ -3,6 +3,19 @@ syntax = "proto3"; package orderbook; option go_package = "github.com/tendermint/tendermint/abci/example/orderbook"; + +message OrderAsk { + uint64 quantity = 1; + uint64 ask_price = 2; + Account owner = 3; +} + +message OrderBid { + uint64 quantity = 1; + uint64 max_price = 2; + Account owner = 3; +} + message Pair { // the denomination that the buyer receives i.e. EUR string buyers_denomination = 1; @@ -44,4 +57,3 @@ message MatchedOrder { repeated bytes buyer_signature = 5; uint64 seller_id = 6; repeated bytes seller_signature = 7; -} \ No newline at end of file