diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a96c425cfb..bd3ecfaf83 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -50,75 +50,75 @@ }, { "ImportPath": "github.com/OpenBazaar/multiwallet", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/bitcoin", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/bitcoincash", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/cache", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/client", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/client/blockbook", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/client/transport", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/config", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/datastore", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/keys", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/litecoin", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/litecoin/address", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/litecoin/params", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/model", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/service", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/util", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/zcash", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/multiwallet/zcash/address", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" }, { "ImportPath": "github.com/OpenBazaar/spvwallet", @@ -2523,7 +2523,7 @@ }, { "ImportPath": "github.com/OpenBazaar/multiwallet/client/errors", - "Rev": "5d687b8c67d127035479739cbf2258f7b275f3e7" + "Rev": "ad30cd2b391bd3c0e06ac858cac585c076074473" } ] } diff --git a/api/jsonapi.go b/api/jsonapi.go index 80bf3f98dc..b8e685ca09 100644 --- a/api/jsonapi.go +++ b/api/jsonapi.go @@ -764,6 +764,17 @@ func (i *jsonAPIHandler) POSTSpendCoinsForOrder(w http.ResponseWriter, r *http.R ErrorResponse(w, http.StatusBadRequest, err.Error()) return } + msg := pb.OrderPaymentTxn{ + Coin: spendArgs.Wallet, + OrderID: result.OrderID, + TransactionID: result.Txid, + WithInput: false, + } + + err = i.node.SendOrderPayment(result.PeerID, &msg) + if err != nil { + log.Errorf("error sending order with id %s payment: %v", result.OrderID, err) + } ser, err := json.MarshalIndent(result, "", " ") if err != nil { diff --git a/core/net.go b/core/net.go index 1e092e32d2..7fc40bcf7b 100644 --- a/core/net.go +++ b/core/net.go @@ -749,3 +749,29 @@ func (n *OpenBazaarNode) SendOfflineRelay(peerID string, encryptedMessage []byte } return n.sendMessage(peerID, nil, m) } + +// SendOrderPayment - send order payment msg to seller from buyer +func (n *OpenBazaarNode) SendOrderPayment(peerID string, paymentMessage *pb.OrderPaymentTxn) error { + a, err := ptypes.MarshalAny(paymentMessage) + if err != nil { + return err + } + m := pb.Message{ + MessageType: pb.Message_ORDER_PAYMENT, + Payload: a, + } + + p, err := peer.IDB58Decode(peerID) + if err != nil { + return err + } + ctx, cancel := context.WithTimeout(context.Background(), n.OfflineMessageFailoverTimeout) + err = n.Service.SendMessage(ctx, p, &m) + cancel() + if err != nil { + if err := n.SendOfflineMessage(p, nil, &m); err != nil { + return err + } + } + return nil +} diff --git a/core/spend.go b/core/spend.go index 24fdb7c3ec..f294f6578f 100644 --- a/core/spend.go +++ b/core/spend.go @@ -37,6 +37,7 @@ type SpendResponse struct { Timestamp time.Time `json:"timestamp"` Txid string `json:"txid"` UnconfirmedBalance int64 `json:"unconfirmedBalance"` + PeerID string `json:"-"` } // Spend will attempt to move funds from the node to the destination address described in the diff --git a/net/retriever/retriever.go b/net/retriever/retriever.go index 626d6548ed..b66125c59e 100644 --- a/net/retriever/retriever.go +++ b/net/retriever/retriever.go @@ -416,6 +416,7 @@ var MessageProcessingOrder = []pb.Message_MessageType{ pb.Message_ORDER_CANCEL, pb.Message_ORDER_REJECT, pb.Message_ORDER_CONFIRMATION, + pb.Message_ORDER_PAYMENT, pb.Message_ORDER_FULFILLMENT, pb.Message_ORDER_COMPLETION, pb.Message_DISPUTE_OPEN, diff --git a/net/service/handlers.go b/net/service/handlers.go index 02547ab5f2..9ac5b1b8b0 100644 --- a/net/service/handlers.go +++ b/net/service/handlers.go @@ -4,20 +4,22 @@ import ( "encoding/hex" "errors" "fmt" + "strconv" + "time" libp2p "gx/ipfs/QmTW4SdgBWq9GjsBsHeUx8WuGxzhgzAf88UMH2w62PC8yK/go-libp2p-crypto" "gx/ipfs/QmTbxNB1NwDesLmKTscr4udL2tVP7MaxvXnD1D9yX7g3PN/go-cid" "gx/ipfs/QmUadX5EcvrBmxAV9sE7wUWtWSqxns5K84qKJBixmcT1w9/go-datastore" peer "gx/ipfs/QmYVXrKrKHDC9FobgmcmshCDyWwdrfwfanNQN4oxJ9Fk3h/go-libp2p-peer" blocks "gx/ipfs/QmYYLnAzR28nAQ4U5MFniLprnktu6eTFKibeNt96V21EZK/go-block-format" - "strconv" - "time" "github.com/OpenBazaar/openbazaar-go/core" "github.com/OpenBazaar/openbazaar-go/net" "github.com/OpenBazaar/openbazaar-go/pb" "github.com/OpenBazaar/openbazaar-go/repo" + u "github.com/OpenBazaar/openbazaar-go/util" "github.com/OpenBazaar/wallet-interface" + "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcutil" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" @@ -68,6 +70,8 @@ func (service *OpenBazaarService) HandlerForMsgType(t pb.Message_MessageType) fu return service.handleVendorFinalizedPayment case pb.Message_STORE: return service.handleStore + case pb.Message_ORDER_PAYMENT: + return service.handleOrderPayment case pb.Message_ERROR: return service.handleError default: @@ -118,7 +122,11 @@ func (service *OpenBazaarService) handleFollow(pid peer.ID, pmes *pb.Message, op if err != nil { return nil, err } - n := repo.FollowNotification{repo.NewNotificationID(), "follow", id.Pretty()} + n := repo.FollowNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeFollowNotification, + PeerId: id.Pretty(), + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) log.Debugf("Received FOLLOW message from %s", id.Pretty()) @@ -161,7 +169,11 @@ func (service *OpenBazaarService) handleUnFollow(pid peer.ID, pmes *pb.Message, if err != nil { return nil, err } - n := repo.UnfollowNotification{repo.NewNotificationID(), "unfollow", id.Pretty()} + n := repo.UnfollowNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeUnfollowNotification, + PeerId: id.Pretty(), + } service.broadcast <- n log.Debugf("Received UNFOLLOW message from %s", id.Pretty()) return nil, nil @@ -487,7 +499,14 @@ func (service *OpenBazaarService) handleOrderConfirmation(p peer.ID, pmes *pb.Me } // Send notification to websocket - n := repo.OrderConfirmationNotification{repo.NewNotificationID(), "orderConfirmation", orderId, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, vendorHandle, vendorID} + n := repo.OrderConfirmationNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeOrderConfirmationNotification, + OrderId: orderId, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + VendorHandle: vendorHandle, + VendorID: vendorID, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) log.Debugf("Received ORDER_CONFIRMATION message from %s", p.Pretty()) @@ -527,7 +546,14 @@ func (service *OpenBazaarService) handleOrderCancel(p peer.ID, pmes *pb.Message, } // Send notification to websocket - n := repo.OrderCancelNotification{repo.NewNotificationID(), "canceled", orderId, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, buyerHandle, buyerID} + n := repo.OrderCancelNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeOrderCancelNotification, + OrderId: orderId, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + BuyerHandle: buyerHandle, + BuyerID: buyerID, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) log.Debugf("Received ORDER_CANCEL message from %s", p.Pretty()) @@ -681,7 +707,14 @@ func (service *OpenBazaarService) handleReject(p peer.ID, pmes *pb.Message, opti } // Send notification to websocket - n := repo.OrderDeclinedNotification{repo.NewNotificationID(), "declined", rejectMsg.OrderID, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, vendorHandle, vendorID} + n := repo.OrderDeclinedNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeOrderDeclinedNotification, + OrderId: rejectMsg.OrderID, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + VendorHandle: vendorHandle, + VendorID: vendorID, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) @@ -802,7 +835,14 @@ func (service *OpenBazaarService) handleRefund(p peer.ID, pmes *pb.Message, opti } // Send notification to websocket - n := repo.RefundNotification{repo.NewNotificationID(), "refund", contract.Refund.OrderID, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, vendorHandle, vendorID} + n := repo.RefundNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeRefundNotification, + OrderId: contract.Refund.OrderID, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + VendorHandle: vendorHandle, + VendorID: vendorID, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) log.Debugf("Received REFUND message from %s", p.Pretty()) @@ -869,10 +909,17 @@ func (service *OpenBazaarService) handleOrderFulfillment(p peer.ID, pmes *pb.Mes } // Send notification to websocket - n := repo.FulfillmentNotification{repo.NewNotificationID(), "fulfillment", rc.VendorOrderFulfillment[0].OrderId, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, vendorHandle, vendorID} + n := repo.FulfillmentNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeFulfillmentNotification, + OrderId: rc.VendorOrderFulfillment[0].OrderId, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + VendorHandle: vendorHandle, + VendorID: vendorID, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) - log.Debugf("Received ORDER_FULFILLMENT message from %s", p.Pretty()) + log.Debugf("received ORDER_FULFILLMENT message from %s", p.Pretty()) return nil, nil } @@ -969,7 +1016,7 @@ func (service *OpenBazaarService) handleOrderCompletion(p peer.ID, pmes *pb.Mess err = service.node.ValidateAndSaveRating(contract) if err != nil { - log.Error("Error validating rating:", err) + log.Error("error validating rating:", err) } // Set message state to complete @@ -989,10 +1036,17 @@ func (service *OpenBazaarService) handleOrderCompletion(p peer.ID, pmes *pb.Mess } // Send notification to websocket - n := repo.CompletionNotification{repo.NewNotificationID(), "orderComplete", rc.BuyerOrderCompletion.OrderId, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, buyerHandle, buyerID} + n := repo.CompletionNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeCompletionNotification, + OrderId: rc.BuyerOrderCompletion.OrderId, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + BuyerHandle: buyerHandle, + BuyerID: buyerID, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) - log.Debugf("Received ORDER_COMPLETION message from %s", p.Pretty()) + log.Debugf("received ORDER_COMPLETION message from %s", p.Pretty()) return nil, nil } @@ -1019,7 +1073,7 @@ func (service *OpenBazaarService) handleDisputeOpen(p peer.ID, pmes *pb.Message, if err != nil { return nil, err } - log.Debugf("Received DISPUTE_OPEN message from %s", p.Pretty()) + log.Debugf("received DISPUTE_OPEN message from %s", p.Pretty()) return nil, nil } @@ -1096,11 +1150,21 @@ func (service *OpenBazaarService) handleDisputeUpdate(p peer.ID, pmes *pb.Messag } // Send notification to websocket - n := repo.DisputeUpdateNotification{repo.NewNotificationID(), "disputeUpdate", update.OrderId, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, disputerID, disputerHandle, disputeeID, disputeeHandle, buyer} + n := repo.DisputeUpdateNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeDisputeUpdateNotification, + OrderId: update.OrderId, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + DisputerID: disputerID, + DisputerHandle: disputerHandle, + DisputeeID: disputeeID, + DisputeeHandle: disputeeHandle, + Buyer: buyer, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) - log.Debugf("Received DISPUTE_UPDATE message from %s", p.Pretty()) + log.Debugf("received DISPUTE_UPDATE message from %s", p.Pretty()) return nil, nil } @@ -1179,11 +1243,19 @@ func (service *OpenBazaarService) handleDisputeClose(p peer.ID, pmes *pb.Message } // Send notification to websocket - n := repo.DisputeCloseNotification{repo.NewNotificationID(), "disputeClose", rc.DisputeResolution.OrderId, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, otherPartyID, otherPartyHandle, buyer} + n := repo.DisputeCloseNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeDisputeCloseNotification, + OrderId: rc.DisputeResolution.OrderId, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + OtherPartyID: otherPartyID, + OtherPartyHandle: otherPartyHandle, + Buyer: buyer, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) - log.Debugf("Received DISPUTE_CLOSE message from %s", p.Pretty()) + log.Debugf("received DISPUTE_CLOSE message from %s", p.Pretty()) return nil, nil } @@ -1268,7 +1340,7 @@ func (service *OpenBazaarService) handleChat(p peer.ID, pmes *pb.Message, option Timestamp: repo.NewAPITime(t), } service.broadcast <- n - log.Debugf("Received CHAT message from %s", p.Pretty()) + log.Debugf("received CHAT message from %s", p.Pretty()) return nil, nil } @@ -1308,7 +1380,7 @@ func (service *OpenBazaarService) handleModeratorAdd(pid peer.ID, pmes *pb.Messa if err != nil { return nil, err } - log.Debugf("Received MODERATOR_ADD message from %s", id.Pretty()) + log.Debugf("received MODERATOR_ADD message from %s", id.Pretty()) return nil, nil } @@ -1349,7 +1421,7 @@ func (service *OpenBazaarService) handleModeratorRemove(pid peer.ID, pmes *pb.Me if err != nil { return nil, err } - log.Debugf("Received MODERATOR_REMOVE message from %s", id.Pretty()) + log.Debugf("received MODERATOR_REMOVE message from %s", id.Pretty()) return nil, nil } @@ -1381,7 +1453,7 @@ func (service *OpenBazaarService) handleBlock(pid peer.ID, pmes *pb.Message, opt if err != nil { return nil, err } - log.Debugf("Received BLOCK message from %s", pid.Pretty()) + log.Debugf("received BLOCK message from %s", pid.Pretty()) return nil, nil } @@ -1411,7 +1483,7 @@ func (service *OpenBazaarService) handleVendorFinalizedPayment(pid peer.ID, pmes } service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) service.broadcast <- n - log.Debugf("Received VENDOR_FINALIZED_PAYMENT message from %s", pid.Pretty()) + log.Debugf("received VENDOR_FINALIZED_PAYMENT message from %s", pid.Pretty()) return nil, nil } @@ -1437,7 +1509,7 @@ func (service *OpenBazaarService) handleStore(pid peer.ID, pmes *pb.Message, opt cList := new(pb.CidList) err := ptypes.UnmarshalAny(pmes.Payload, cList) if err != nil { - return errorResponse("Could not unmarshall message"), err + return errorResponse("could not unmarshall message"), err } var need []string for _, id := range cList.Cids { @@ -1466,6 +1538,105 @@ func (service *OpenBazaarService) handleStore(pid peer.ID, pmes *pb.Message, opt return m, nil } +func (service *OpenBazaarService) handleOrderPayment(peer peer.ID, pmes *pb.Message, options interface{}) (*pb.Message, error) { + // Unmarshal + if pmes.Payload == nil { + return nil, errors.New("payload is nil") + } + paymentDetails := new(pb.OrderPaymentTxn) + err := ptypes.UnmarshalAny(pmes.Payload, paymentDetails) + if err != nil { + return nil, err + } + + wal, err := service.node.Multiwallet.WalletForCurrencyCode(paymentDetails.GetCoin()) + if err != nil { + return nil, err + } + + wal0, ok := wal.(wallet.WalletMustManuallyAssociateTransactionToOrder) + if !ok { + return nil, nil + } + + chash, err := chainhash.NewHashFromStr(paymentDetails.GetTransactionID()) + if err != nil { + return nil, err + } + + txn, err := wal.GetTransaction(*chash) + if err != nil { + return nil, err + } + + contract, _, _, _, _, _, err := service.datastore.Sales().GetByOrderId(paymentDetails.OrderID) + if err != nil { + return nil, net.OutOfOrderMessage + } + + if contract.VendorOrderConfirmation != nil && + contract.BuyerOrder.Payment.Method != pb.Order_Payment_MODERATED { + + // the seller has confirmed the direct order, so a simple check of + // the addresses and we are good to proceed + if !u.AreAddressesEqual(contract.VendorOrderConfirmation.PaymentAddress, txn.ToAddress) { + log.Errorf("mismatched payment address details: orderID: %s, expectedAddr: %s, actualAddr: %s", + paymentDetails.OrderID, contract.VendorOrderConfirmation.PaymentAddress, txn.ToAddress) + return nil, errors.New("mismatched payment addresses") + + } + + } else { + // the seller has not confirmed or this is a moderated purchase, + // so we need to compare the peerID in the vendorListing + // to the node peerID + if contract.VendorListings[0].VendorID.PeerID != + service.node.IpfsNode.Identity.Pretty() { + log.Errorf("mismatched peerID. wrong node is processing: orderID: %s, contractPeerID: %s", + paymentDetails.OrderID, contract.VendorListings[0].VendorID.PeerID) + return nil, errors.New("mismatched peer id") + } + } + + toAddress, _ := wal.DecodeAddress(txn.ToAddress) + outputs := []wallet.TransactionOutput{} + for _, o := range txn.Outputs { + output := wallet.TransactionOutput{ + Address: o.Address, + Value: o.Value, + Index: o.Index, + OrderID: paymentDetails.OrderID, + } + outputs = append(outputs, output) + } + + input := wallet.TransactionInput{} + + if paymentDetails.WithInput { + input = wallet.TransactionInput{ + OutpointHash: []byte(txn.Txid[:32]), + OutpointIndex: 1, + LinkedAddress: toAddress, + Value: txn.Value, + OrderID: paymentDetails.OrderID, + } + } + + cb := wallet.TransactionCallback{ + Txid: txn.Txid, + Outputs: outputs, + Inputs: []wallet.TransactionInput{input}, + Height: 0, + Timestamp: time.Now(), + Value: txn.Value, + WatchOnly: false, + } + + wal0.AssociateTransactionWithOrder(cb) + + return nil, nil +} + func (service *OpenBazaarService) handleError(peer peer.ID, pmes *pb.Message, options interface{}) (*pb.Message, error) { if pmes.Payload == nil { return nil, errors.New("payload is nil") @@ -1503,9 +1674,16 @@ func (service *OpenBazaarService) handleError(peer peer.ID, pmes *pb.Message, op } // Send notification to websocket - n := repo.ProcessingErrorNotification{repo.NewNotificationID(), "processingError", errorMessage.OrderID, repo.Thumbnail{thumbnailTiny, thumbnailSmall}, vendorHandle, vendorID} + n := repo.ProcessingErrorNotification{ + ID: repo.NewNotificationID(), + Type: repo.NotifierTypeProcessingErrorNotification, + OrderId: errorMessage.OrderID, + Thumbnail: repo.Thumbnail{Tiny: thumbnailTiny, Small: thumbnailSmall}, + VendorHandle: vendorHandle, + VendorID: vendorID, + } service.broadcast <- n service.datastore.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false)) - log.Debugf("Received ERROR message from %s:%s", peer.Pretty(), errorMessage.ErrorMessage) + log.Debugf("received ERROR message from %s:%s", peer.Pretty(), errorMessage.ErrorMessage) return nil, nil } diff --git a/pb/api.pb.go b/pb/api.pb.go index 2c54c12b3b..01eeb03bec 100644 --- a/pb/api.pb.go +++ b/pb/api.pb.go @@ -3,10 +3,12 @@ package pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import timestamp "github.com/golang/protobuf/ptypes/timestamp" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -17,7 +19,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Coupon struct { Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` @@ -31,16 +33,17 @@ func (m *Coupon) Reset() { *m = Coupon{} } func (m *Coupon) String() string { return proto.CompactTextString(m) } func (*Coupon) ProtoMessage() {} func (*Coupon) Descriptor() ([]byte, []int) { - return fileDescriptor_api_edd1d70a1d723184, []int{0} + return fileDescriptor_00212fb1f9d3bf1c, []int{0} } + func (m *Coupon) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Coupon.Unmarshal(m, b) } func (m *Coupon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Coupon.Marshal(b, m, deterministic) } -func (dst *Coupon) XXX_Merge(src proto.Message) { - xxx_messageInfo_Coupon.Merge(dst, src) +func (m *Coupon) XXX_Merge(src proto.Message) { + xxx_messageInfo_Coupon.Merge(m, src) } func (m *Coupon) XXX_Size() int { return xxx_messageInfo_Coupon.Size(m) @@ -82,16 +85,17 @@ func (m *OrderRespApi) Reset() { *m = OrderRespApi{} } func (m *OrderRespApi) String() string { return proto.CompactTextString(m) } func (*OrderRespApi) ProtoMessage() {} func (*OrderRespApi) Descriptor() ([]byte, []int) { - return fileDescriptor_api_edd1d70a1d723184, []int{1} + return fileDescriptor_00212fb1f9d3bf1c, []int{1} } + func (m *OrderRespApi) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderRespApi.Unmarshal(m, b) } func (m *OrderRespApi) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderRespApi.Marshal(b, m, deterministic) } -func (dst *OrderRespApi) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderRespApi.Merge(dst, src) +func (m *OrderRespApi) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderRespApi.Merge(m, src) } func (m *OrderRespApi) XXX_Size() int { return xxx_messageInfo_OrderRespApi.Size(m) @@ -172,16 +176,17 @@ func (m *CaseRespApi) Reset() { *m = CaseRespApi{} } func (m *CaseRespApi) String() string { return proto.CompactTextString(m) } func (*CaseRespApi) ProtoMessage() {} func (*CaseRespApi) Descriptor() ([]byte, []int) { - return fileDescriptor_api_edd1d70a1d723184, []int{2} + return fileDescriptor_00212fb1f9d3bf1c, []int{2} } + func (m *CaseRespApi) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CaseRespApi.Unmarshal(m, b) } func (m *CaseRespApi) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_CaseRespApi.Marshal(b, m, deterministic) } -func (dst *CaseRespApi) XXX_Merge(src proto.Message) { - xxx_messageInfo_CaseRespApi.Merge(dst, src) +func (m *CaseRespApi) XXX_Merge(src proto.Message) { + xxx_messageInfo_CaseRespApi.Merge(m, src) } func (m *CaseRespApi) XXX_Size() int { return xxx_messageInfo_CaseRespApi.Size(m) @@ -284,16 +289,17 @@ func (m *TransactionRecord) Reset() { *m = TransactionRecord{} } func (m *TransactionRecord) String() string { return proto.CompactTextString(m) } func (*TransactionRecord) ProtoMessage() {} func (*TransactionRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_api_edd1d70a1d723184, []int{3} + return fileDescriptor_00212fb1f9d3bf1c, []int{3} } + func (m *TransactionRecord) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransactionRecord.Unmarshal(m, b) } func (m *TransactionRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TransactionRecord.Marshal(b, m, deterministic) } -func (dst *TransactionRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransactionRecord.Merge(dst, src) +func (m *TransactionRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionRecord.Merge(m, src) } func (m *TransactionRecord) XXX_Size() int { return xxx_messageInfo_TransactionRecord.Size(m) @@ -351,16 +357,17 @@ func (m *PeerAndProfile) Reset() { *m = PeerAndProfile{} } func (m *PeerAndProfile) String() string { return proto.CompactTextString(m) } func (*PeerAndProfile) ProtoMessage() {} func (*PeerAndProfile) Descriptor() ([]byte, []int) { - return fileDescriptor_api_edd1d70a1d723184, []int{4} + return fileDescriptor_00212fb1f9d3bf1c, []int{4} } + func (m *PeerAndProfile) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PeerAndProfile.Unmarshal(m, b) } func (m *PeerAndProfile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PeerAndProfile.Marshal(b, m, deterministic) } -func (dst *PeerAndProfile) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerAndProfile.Merge(dst, src) +func (m *PeerAndProfile) XXX_Merge(src proto.Message) { + xxx_messageInfo_PeerAndProfile.Merge(m, src) } func (m *PeerAndProfile) XXX_Size() int { return xxx_messageInfo_PeerAndProfile.Size(m) @@ -398,16 +405,17 @@ func (m *PeerAndProfileWithID) Reset() { *m = PeerAndProfileWithID{} } func (m *PeerAndProfileWithID) String() string { return proto.CompactTextString(m) } func (*PeerAndProfileWithID) ProtoMessage() {} func (*PeerAndProfileWithID) Descriptor() ([]byte, []int) { - return fileDescriptor_api_edd1d70a1d723184, []int{5} + return fileDescriptor_00212fb1f9d3bf1c, []int{5} } + func (m *PeerAndProfileWithID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PeerAndProfileWithID.Unmarshal(m, b) } func (m *PeerAndProfileWithID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PeerAndProfileWithID.Marshal(b, m, deterministic) } -func (dst *PeerAndProfileWithID) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerAndProfileWithID.Merge(dst, src) +func (m *PeerAndProfileWithID) XXX_Merge(src proto.Message) { + xxx_messageInfo_PeerAndProfileWithID.Merge(m, src) } func (m *PeerAndProfileWithID) XXX_Size() int { return xxx_messageInfo_PeerAndProfileWithID.Size(m) @@ -452,16 +460,17 @@ func (m *RatingWithID) Reset() { *m = RatingWithID{} } func (m *RatingWithID) String() string { return proto.CompactTextString(m) } func (*RatingWithID) ProtoMessage() {} func (*RatingWithID) Descriptor() ([]byte, []int) { - return fileDescriptor_api_edd1d70a1d723184, []int{6} + return fileDescriptor_00212fb1f9d3bf1c, []int{6} } + func (m *RatingWithID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RatingWithID.Unmarshal(m, b) } func (m *RatingWithID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RatingWithID.Marshal(b, m, deterministic) } -func (dst *RatingWithID) XXX_Merge(src proto.Message) { - xxx_messageInfo_RatingWithID.Merge(dst, src) +func (m *RatingWithID) XXX_Merge(src proto.Message) { + xxx_messageInfo_RatingWithID.Merge(m, src) } func (m *RatingWithID) XXX_Size() int { return xxx_messageInfo_RatingWithID.Size(m) @@ -503,9 +512,9 @@ func init() { proto.RegisterType((*RatingWithID)(nil), "RatingWithID") } -func init() { proto.RegisterFile("api.proto", fileDescriptor_api_edd1d70a1d723184) } +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } -var fileDescriptor_api_edd1d70a1d723184 = []byte{ +var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 625 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0x13, 0x31, 0x10, 0x56, 0xfe, 0x93, 0x49, 0x13, 0x84, 0x55, 0xa1, 0x55, 0x24, 0x68, 0x58, 0x71, 0xc8, 0x69, diff --git a/pb/contracts.pb.go b/pb/contracts.pb.go index 3e941d34ed..e659bc8494 100644 --- a/pb/contracts.pb.go +++ b/pb/contracts.pb.go @@ -3,10 +3,12 @@ package pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import timestamp "github.com/golang/protobuf/ptypes/timestamp" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -17,7 +19,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Listing_Metadata_ContractType int32 @@ -36,6 +38,7 @@ var Listing_Metadata_ContractType_name = map[int32]string{ 3: "CROWD_FUND", 4: "CRYPTOCURRENCY", } + var Listing_Metadata_ContractType_value = map[string]int32{ "PHYSICAL_GOOD": 0, "DIGITAL_GOOD": 1, @@ -47,8 +50,9 @@ var Listing_Metadata_ContractType_value = map[string]int32{ func (x Listing_Metadata_ContractType) String() string { return proto.EnumName(Listing_Metadata_ContractType_name, int32(x)) } + func (Listing_Metadata_ContractType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 0, 0} + return fileDescriptor_b6d125f880f9ca35, []int{1, 0, 0} } type Listing_Metadata_Format int32 @@ -62,6 +66,7 @@ var Listing_Metadata_Format_name = map[int32]string{ 0: "FIXED_PRICE", 2: "MARKET_PRICE", } + var Listing_Metadata_Format_value = map[string]int32{ "FIXED_PRICE": 0, "MARKET_PRICE": 2, @@ -70,8 +75,9 @@ var Listing_Metadata_Format_value = map[string]int32{ func (x Listing_Metadata_Format) String() string { return proto.EnumName(Listing_Metadata_Format_name, int32(x)) } + func (Listing_Metadata_Format) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 0, 1} + return fileDescriptor_b6d125f880f9ca35, []int{1, 0, 1} } type Listing_ShippingOption_ShippingType int32 @@ -85,6 +91,7 @@ var Listing_ShippingOption_ShippingType_name = map[int32]string{ 0: "LOCAL_PICKUP", 1: "FIXED_PRICE", } + var Listing_ShippingOption_ShippingType_value = map[string]int32{ "LOCAL_PICKUP": 0, "FIXED_PRICE": 1, @@ -93,8 +100,9 @@ var Listing_ShippingOption_ShippingType_value = map[string]int32{ func (x Listing_ShippingOption_ShippingType) String() string { return proto.EnumName(Listing_ShippingOption_ShippingType_name, int32(x)) } + func (Listing_ShippingOption_ShippingType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 2, 0} + return fileDescriptor_b6d125f880f9ca35, []int{1, 2, 0} } type Order_Payment_Method int32 @@ -110,6 +118,7 @@ var Order_Payment_Method_name = map[int32]string{ 1: "DIRECT", 2: "MODERATED", } + var Order_Payment_Method_value = map[string]int32{ "ADDRESS_REQUEST": 0, "DIRECT": 1, @@ -119,8 +128,9 @@ var Order_Payment_Method_value = map[string]int32{ func (x Order_Payment_Method) String() string { return proto.EnumName(Order_Payment_Method_name, int32(x)) } + func (Order_Payment_Method) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{2, 2, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 2, 0} } type Signature_Section int32 @@ -146,6 +156,7 @@ var Signature_Section_name = map[int32]string{ 6: "DISPUTE_RESOLUTION", 7: "REFUND", } + var Signature_Section_value = map[string]int32{ "LISTING": 0, "ORDER": 1, @@ -160,8 +171,9 @@ var Signature_Section_value = map[string]int32{ func (x Signature_Section) String() string { return proto.EnumName(Signature_Section_name, int32(x)) } + func (Signature_Section) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{17, 0} + return fileDescriptor_b6d125f880f9ca35, []int{17, 0} } type RicardianContract struct { @@ -185,16 +197,17 @@ func (m *RicardianContract) Reset() { *m = RicardianContract{} } func (m *RicardianContract) String() string { return proto.CompactTextString(m) } func (*RicardianContract) ProtoMessage() {} func (*RicardianContract) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{0} + return fileDescriptor_b6d125f880f9ca35, []int{0} } + func (m *RicardianContract) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RicardianContract.Unmarshal(m, b) } func (m *RicardianContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RicardianContract.Marshal(b, m, deterministic) } -func (dst *RicardianContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_RicardianContract.Merge(dst, src) +func (m *RicardianContract) XXX_Merge(src proto.Message) { + xxx_messageInfo_RicardianContract.Merge(m, src) } func (m *RicardianContract) XXX_Size() int { return xxx_messageInfo_RicardianContract.Size(m) @@ -302,16 +315,17 @@ func (m *Listing) Reset() { *m = Listing{} } func (m *Listing) String() string { return proto.CompactTextString(m) } func (*Listing) ProtoMessage() {} func (*Listing) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1} + return fileDescriptor_b6d125f880f9ca35, []int{1} } + func (m *Listing) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing.Unmarshal(m, b) } func (m *Listing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing.Marshal(b, m, deterministic) } -func (dst *Listing) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing.Merge(dst, src) +func (m *Listing) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing.Merge(m, src) } func (m *Listing) XXX_Size() int { return xxx_messageInfo_Listing.Size(m) @@ -413,16 +427,17 @@ func (m *Listing_Metadata) Reset() { *m = Listing_Metadata{} } func (m *Listing_Metadata) String() string { return proto.CompactTextString(m) } func (*Listing_Metadata) ProtoMessage() {} func (*Listing_Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 0} + return fileDescriptor_b6d125f880f9ca35, []int{1, 0} } + func (m *Listing_Metadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_Metadata.Unmarshal(m, b) } func (m *Listing_Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_Metadata.Marshal(b, m, deterministic) } -func (dst *Listing_Metadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_Metadata.Merge(dst, src) +func (m *Listing_Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_Metadata.Merge(m, src) } func (m *Listing_Metadata) XXX_Size() int { return xxx_messageInfo_Listing_Metadata.Size(m) @@ -532,16 +547,17 @@ func (m *Listing_Item) Reset() { *m = Listing_Item{} } func (m *Listing_Item) String() string { return proto.CompactTextString(m) } func (*Listing_Item) ProtoMessage() {} func (*Listing_Item) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 1} + return fileDescriptor_b6d125f880f9ca35, []int{1, 1} } + func (m *Listing_Item) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_Item.Unmarshal(m, b) } func (m *Listing_Item) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_Item.Marshal(b, m, deterministic) } -func (dst *Listing_Item) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_Item.Merge(dst, src) +func (m *Listing_Item) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_Item.Merge(m, src) } func (m *Listing_Item) XXX_Size() int { return xxx_messageInfo_Listing_Item.Size(m) @@ -649,16 +665,17 @@ func (m *Listing_Item_Option) Reset() { *m = Listing_Item_Option{} } func (m *Listing_Item_Option) String() string { return proto.CompactTextString(m) } func (*Listing_Item_Option) ProtoMessage() {} func (*Listing_Item_Option) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 1, 0} + return fileDescriptor_b6d125f880f9ca35, []int{1, 1, 0} } + func (m *Listing_Item_Option) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_Item_Option.Unmarshal(m, b) } func (m *Listing_Item_Option) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_Item_Option.Marshal(b, m, deterministic) } -func (dst *Listing_Item_Option) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_Item_Option.Merge(dst, src) +func (m *Listing_Item_Option) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_Item_Option.Merge(m, src) } func (m *Listing_Item_Option) XXX_Size() int { return xxx_messageInfo_Listing_Item_Option.Size(m) @@ -702,16 +719,17 @@ func (m *Listing_Item_Option_Variant) Reset() { *m = Listing_Item_Option func (m *Listing_Item_Option_Variant) String() string { return proto.CompactTextString(m) } func (*Listing_Item_Option_Variant) ProtoMessage() {} func (*Listing_Item_Option_Variant) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 1, 0, 0} + return fileDescriptor_b6d125f880f9ca35, []int{1, 1, 0, 0} } + func (m *Listing_Item_Option_Variant) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_Item_Option_Variant.Unmarshal(m, b) } func (m *Listing_Item_Option_Variant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_Item_Option_Variant.Marshal(b, m, deterministic) } -func (dst *Listing_Item_Option_Variant) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_Item_Option_Variant.Merge(dst, src) +func (m *Listing_Item_Option_Variant) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_Item_Option_Variant.Merge(m, src) } func (m *Listing_Item_Option_Variant) XXX_Size() int { return xxx_messageInfo_Listing_Item_Option_Variant.Size(m) @@ -750,16 +768,17 @@ func (m *Listing_Item_Sku) Reset() { *m = Listing_Item_Sku{} } func (m *Listing_Item_Sku) String() string { return proto.CompactTextString(m) } func (*Listing_Item_Sku) ProtoMessage() {} func (*Listing_Item_Sku) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 1, 1} + return fileDescriptor_b6d125f880f9ca35, []int{1, 1, 1} } + func (m *Listing_Item_Sku) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_Item_Sku.Unmarshal(m, b) } func (m *Listing_Item_Sku) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_Item_Sku.Marshal(b, m, deterministic) } -func (dst *Listing_Item_Sku) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_Item_Sku.Merge(dst, src) +func (m *Listing_Item_Sku) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_Item_Sku.Merge(m, src) } func (m *Listing_Item_Sku) XXX_Size() int { return xxx_messageInfo_Listing_Item_Sku.Size(m) @@ -814,16 +833,17 @@ func (m *Listing_Item_Image) Reset() { *m = Listing_Item_Image{} } func (m *Listing_Item_Image) String() string { return proto.CompactTextString(m) } func (*Listing_Item_Image) ProtoMessage() {} func (*Listing_Item_Image) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 1, 2} + return fileDescriptor_b6d125f880f9ca35, []int{1, 1, 2} } + func (m *Listing_Item_Image) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_Item_Image.Unmarshal(m, b) } func (m *Listing_Item_Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_Item_Image.Marshal(b, m, deterministic) } -func (dst *Listing_Item_Image) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_Item_Image.Merge(dst, src) +func (m *Listing_Item_Image) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_Item_Image.Merge(m, src) } func (m *Listing_Item_Image) XXX_Size() int { return xxx_messageInfo_Listing_Item_Image.Size(m) @@ -890,16 +910,17 @@ func (m *Listing_ShippingOption) Reset() { *m = Listing_ShippingOption{} func (m *Listing_ShippingOption) String() string { return proto.CompactTextString(m) } func (*Listing_ShippingOption) ProtoMessage() {} func (*Listing_ShippingOption) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 2} + return fileDescriptor_b6d125f880f9ca35, []int{1, 2} } + func (m *Listing_ShippingOption) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_ShippingOption.Unmarshal(m, b) } func (m *Listing_ShippingOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_ShippingOption.Marshal(b, m, deterministic) } -func (dst *Listing_ShippingOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_ShippingOption.Merge(dst, src) +func (m *Listing_ShippingOption) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_ShippingOption.Merge(m, src) } func (m *Listing_ShippingOption) XXX_Size() int { return xxx_messageInfo_Listing_ShippingOption.Size(m) @@ -952,16 +973,17 @@ func (m *Listing_ShippingOption_Service) Reset() { *m = Listing_Shipping func (m *Listing_ShippingOption_Service) String() string { return proto.CompactTextString(m) } func (*Listing_ShippingOption_Service) ProtoMessage() {} func (*Listing_ShippingOption_Service) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 2, 0} + return fileDescriptor_b6d125f880f9ca35, []int{1, 2, 0} } + func (m *Listing_ShippingOption_Service) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_ShippingOption_Service.Unmarshal(m, b) } func (m *Listing_ShippingOption_Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_ShippingOption_Service.Marshal(b, m, deterministic) } -func (dst *Listing_ShippingOption_Service) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_ShippingOption_Service.Merge(dst, src) +func (m *Listing_ShippingOption_Service) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_ShippingOption_Service.Merge(m, src) } func (m *Listing_ShippingOption_Service) XXX_Size() int { return xxx_messageInfo_Listing_ShippingOption_Service.Size(m) @@ -1014,16 +1036,17 @@ func (m *Listing_Tax) Reset() { *m = Listing_Tax{} } func (m *Listing_Tax) String() string { return proto.CompactTextString(m) } func (*Listing_Tax) ProtoMessage() {} func (*Listing_Tax) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 3} + return fileDescriptor_b6d125f880f9ca35, []int{1, 3} } + func (m *Listing_Tax) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_Tax.Unmarshal(m, b) } func (m *Listing_Tax) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_Tax.Marshal(b, m, deterministic) } -func (dst *Listing_Tax) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_Tax.Merge(dst, src) +func (m *Listing_Tax) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_Tax.Merge(m, src) } func (m *Listing_Tax) XXX_Size() int { return xxx_messageInfo_Listing_Tax.Size(m) @@ -1081,16 +1104,17 @@ func (m *Listing_Coupon) Reset() { *m = Listing_Coupon{} } func (m *Listing_Coupon) String() string { return proto.CompactTextString(m) } func (*Listing_Coupon) ProtoMessage() {} func (*Listing_Coupon) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{1, 4} + return fileDescriptor_b6d125f880f9ca35, []int{1, 4} } + func (m *Listing_Coupon) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Listing_Coupon.Unmarshal(m, b) } func (m *Listing_Coupon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Listing_Coupon.Marshal(b, m, deterministic) } -func (dst *Listing_Coupon) XXX_Merge(src proto.Message) { - xxx_messageInfo_Listing_Coupon.Merge(dst, src) +func (m *Listing_Coupon) XXX_Merge(src proto.Message) { + xxx_messageInfo_Listing_Coupon.Merge(m, src) } func (m *Listing_Coupon) XXX_Size() int { return xxx_messageInfo_Listing_Coupon.Size(m) @@ -1101,30 +1125,28 @@ func (m *Listing_Coupon) XXX_DiscardUnknown() { var xxx_messageInfo_Listing_Coupon proto.InternalMessageInfo +func (m *Listing_Coupon) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + type isListing_Coupon_Code interface { isListing_Coupon_Code() } -type isListing_Coupon_Discount interface { - isListing_Coupon_Discount() -} type Listing_Coupon_Hash struct { Hash string `protobuf:"bytes,2,opt,name=hash,proto3,oneof"` } + type Listing_Coupon_DiscountCode struct { DiscountCode string `protobuf:"bytes,3,opt,name=discountCode,proto3,oneof"` } -type Listing_Coupon_PercentDiscount struct { - PercentDiscount float32 `protobuf:"fixed32,5,opt,name=percentDiscount,proto3,oneof"` -} -type Listing_Coupon_PriceDiscount struct { - PriceDiscount uint64 `protobuf:"varint,6,opt,name=priceDiscount,proto3,oneof"` -} -func (*Listing_Coupon_Hash) isListing_Coupon_Code() {} -func (*Listing_Coupon_DiscountCode) isListing_Coupon_Code() {} -func (*Listing_Coupon_PercentDiscount) isListing_Coupon_Discount() {} -func (*Listing_Coupon_PriceDiscount) isListing_Coupon_Discount() {} +func (*Listing_Coupon_Hash) isListing_Coupon_Code() {} + +func (*Listing_Coupon_DiscountCode) isListing_Coupon_Code() {} func (m *Listing_Coupon) GetCode() isListing_Coupon_Code { if m != nil { @@ -1132,19 +1154,6 @@ func (m *Listing_Coupon) GetCode() isListing_Coupon_Code { } return nil } -func (m *Listing_Coupon) GetDiscount() isListing_Coupon_Discount { - if m != nil { - return m.Discount - } - return nil -} - -func (m *Listing_Coupon) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} func (m *Listing_Coupon) GetHash() string { if x, ok := m.GetCode().(*Listing_Coupon_Hash); ok { @@ -1160,6 +1169,29 @@ func (m *Listing_Coupon) GetDiscountCode() string { return "" } +type isListing_Coupon_Discount interface { + isListing_Coupon_Discount() +} + +type Listing_Coupon_PercentDiscount struct { + PercentDiscount float32 `protobuf:"fixed32,5,opt,name=percentDiscount,proto3,oneof"` +} + +type Listing_Coupon_PriceDiscount struct { + PriceDiscount uint64 `protobuf:"varint,6,opt,name=priceDiscount,proto3,oneof"` +} + +func (*Listing_Coupon_PercentDiscount) isListing_Coupon_Discount() {} + +func (*Listing_Coupon_PriceDiscount) isListing_Coupon_Discount() {} + +func (m *Listing_Coupon) GetDiscount() isListing_Coupon_Discount { + if m != nil { + return m.Discount + } + return nil +} + func (m *Listing_Coupon) GetPercentDiscount() float32 { if x, ok := m.GetDiscount().(*Listing_Coupon_PercentDiscount); ok { return x.PercentDiscount @@ -1174,9 +1206,9 @@ func (m *Listing_Coupon) GetPriceDiscount() uint64 { return 0 } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Listing_Coupon) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Listing_Coupon_OneofMarshaler, _Listing_Coupon_OneofUnmarshaler, _Listing_Coupon_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Listing_Coupon) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Listing_Coupon_Hash)(nil), (*Listing_Coupon_DiscountCode)(nil), (*Listing_Coupon_PercentDiscount)(nil), @@ -1184,102 +1216,6 @@ func (*Listing_Coupon) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer } } -func _Listing_Coupon_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Listing_Coupon) - // code - switch x := m.Code.(type) { - case *Listing_Coupon_Hash: - b.EncodeVarint(2<<3 | proto.WireBytes) - b.EncodeStringBytes(x.Hash) - case *Listing_Coupon_DiscountCode: - b.EncodeVarint(3<<3 | proto.WireBytes) - b.EncodeStringBytes(x.DiscountCode) - case nil: - default: - return fmt.Errorf("Listing_Coupon.Code has unexpected type %T", x) - } - // discount - switch x := m.Discount.(type) { - case *Listing_Coupon_PercentDiscount: - b.EncodeVarint(5<<3 | proto.WireFixed32) - b.EncodeFixed32(uint64(math.Float32bits(x.PercentDiscount))) - case *Listing_Coupon_PriceDiscount: - b.EncodeVarint(6<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.PriceDiscount)) - case nil: - default: - return fmt.Errorf("Listing_Coupon.Discount has unexpected type %T", x) - } - return nil -} - -func _Listing_Coupon_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Listing_Coupon) - switch tag { - case 2: // code.hash - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Code = &Listing_Coupon_Hash{x} - return true, err - case 3: // code.discountCode - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Code = &Listing_Coupon_DiscountCode{x} - return true, err - case 5: // discount.percentDiscount - if wire != proto.WireFixed32 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed32() - m.Discount = &Listing_Coupon_PercentDiscount{math.Float32frombits(uint32(x))} - return true, err - case 6: // discount.priceDiscount - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Discount = &Listing_Coupon_PriceDiscount{x} - return true, err - default: - return false, nil - } -} - -func _Listing_Coupon_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Listing_Coupon) - // code - switch x := m.Code.(type) { - case *Listing_Coupon_Hash: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Hash))) - n += len(x.Hash) - case *Listing_Coupon_DiscountCode: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.DiscountCode))) - n += len(x.DiscountCode) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - // discount - switch x := m.Discount.(type) { - case *Listing_Coupon_PercentDiscount: - n += 1 // tag and wire - n += 4 - case *Listing_Coupon_PriceDiscount: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.PriceDiscount)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type Order struct { RefundAddress string `protobuf:"bytes,1,opt,name=refundAddress,proto3" json:"refundAddress,omitempty"` RefundFee uint64 `protobuf:"varint,2,opt,name=refundFee,proto3" json:"refundFee,omitempty"` @@ -1300,16 +1236,17 @@ func (m *Order) Reset() { *m = Order{} } func (m *Order) String() string { return proto.CompactTextString(m) } func (*Order) ProtoMessage() {} func (*Order) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{2} + return fileDescriptor_b6d125f880f9ca35, []int{2} } + func (m *Order) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Order.Unmarshal(m, b) } func (m *Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Order.Marshal(b, m, deterministic) } -func (dst *Order) XXX_Merge(src proto.Message) { - xxx_messageInfo_Order.Merge(dst, src) +func (m *Order) XXX_Merge(src proto.Message) { + xxx_messageInfo_Order.Merge(m, src) } func (m *Order) XXX_Size() int { return xxx_messageInfo_Order.Size(m) @@ -1407,16 +1344,17 @@ func (m *Order_Shipping) Reset() { *m = Order_Shipping{} } func (m *Order_Shipping) String() string { return proto.CompactTextString(m) } func (*Order_Shipping) ProtoMessage() {} func (*Order_Shipping) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{2, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 0} } + func (m *Order_Shipping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Order_Shipping.Unmarshal(m, b) } func (m *Order_Shipping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Order_Shipping.Marshal(b, m, deterministic) } -func (dst *Order_Shipping) XXX_Merge(src proto.Message) { - xxx_messageInfo_Order_Shipping.Merge(dst, src) +func (m *Order_Shipping) XXX_Merge(src proto.Message) { + xxx_messageInfo_Order_Shipping.Merge(m, src) } func (m *Order_Shipping) XXX_Size() int { return xxx_messageInfo_Order_Shipping.Size(m) @@ -1494,16 +1432,17 @@ func (m *Order_Item) Reset() { *m = Order_Item{} } func (m *Order_Item) String() string { return proto.CompactTextString(m) } func (*Order_Item) ProtoMessage() {} func (*Order_Item) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{2, 1} + return fileDescriptor_b6d125f880f9ca35, []int{2, 1} } + func (m *Order_Item) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Order_Item.Unmarshal(m, b) } func (m *Order_Item) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Order_Item.Marshal(b, m, deterministic) } -func (dst *Order_Item) XXX_Merge(src proto.Message) { - xxx_messageInfo_Order_Item.Merge(dst, src) +func (m *Order_Item) XXX_Merge(src proto.Message) { + xxx_messageInfo_Order_Item.Merge(m, src) } func (m *Order_Item) XXX_Size() int { return xxx_messageInfo_Order_Item.Size(m) @@ -1582,16 +1521,17 @@ func (m *Order_Item_Option) Reset() { *m = Order_Item_Option{} } func (m *Order_Item_Option) String() string { return proto.CompactTextString(m) } func (*Order_Item_Option) ProtoMessage() {} func (*Order_Item_Option) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{2, 1, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 1, 0} } + func (m *Order_Item_Option) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Order_Item_Option.Unmarshal(m, b) } func (m *Order_Item_Option) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Order_Item_Option.Marshal(b, m, deterministic) } -func (dst *Order_Item_Option) XXX_Merge(src proto.Message) { - xxx_messageInfo_Order_Item_Option.Merge(dst, src) +func (m *Order_Item_Option) XXX_Merge(src proto.Message) { + xxx_messageInfo_Order_Item_Option.Merge(m, src) } func (m *Order_Item_Option) XXX_Size() int { return xxx_messageInfo_Order_Item_Option.Size(m) @@ -1628,16 +1568,17 @@ func (m *Order_Item_ShippingOption) Reset() { *m = Order_Item_ShippingOp func (m *Order_Item_ShippingOption) String() string { return proto.CompactTextString(m) } func (*Order_Item_ShippingOption) ProtoMessage() {} func (*Order_Item_ShippingOption) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{2, 1, 1} + return fileDescriptor_b6d125f880f9ca35, []int{2, 1, 1} } + func (m *Order_Item_ShippingOption) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Order_Item_ShippingOption.Unmarshal(m, b) } func (m *Order_Item_ShippingOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Order_Item_ShippingOption.Marshal(b, m, deterministic) } -func (dst *Order_Item_ShippingOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_Order_Item_ShippingOption.Merge(dst, src) +func (m *Order_Item_ShippingOption) XXX_Merge(src proto.Message) { + xxx_messageInfo_Order_Item_ShippingOption.Merge(m, src) } func (m *Order_Item_ShippingOption) XXX_Size() int { return xxx_messageInfo_Order_Item_ShippingOption.Size(m) @@ -1680,16 +1621,17 @@ func (m *Order_Payment) Reset() { *m = Order_Payment{} } func (m *Order_Payment) String() string { return proto.CompactTextString(m) } func (*Order_Payment) ProtoMessage() {} func (*Order_Payment) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{2, 2} + return fileDescriptor_b6d125f880f9ca35, []int{2, 2} } + func (m *Order_Payment) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Order_Payment.Unmarshal(m, b) } func (m *Order_Payment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Order_Payment.Marshal(b, m, deterministic) } -func (dst *Order_Payment) XXX_Merge(src proto.Message) { - xxx_messageInfo_Order_Payment.Merge(dst, src) +func (m *Order_Payment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Order_Payment.Merge(m, src) } func (m *Order_Payment) XXX_Size() int { return xxx_messageInfo_Order_Payment.Size(m) @@ -1772,16 +1714,17 @@ func (m *OrderConfirmation) Reset() { *m = OrderConfirmation{} } func (m *OrderConfirmation) String() string { return proto.CompactTextString(m) } func (*OrderConfirmation) ProtoMessage() {} func (*OrderConfirmation) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{3} + return fileDescriptor_b6d125f880f9ca35, []int{3} } + func (m *OrderConfirmation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderConfirmation.Unmarshal(m, b) } func (m *OrderConfirmation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderConfirmation.Marshal(b, m, deterministic) } -func (dst *OrderConfirmation) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderConfirmation.Merge(dst, src) +func (m *OrderConfirmation) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderConfirmation.Merge(m, src) } func (m *OrderConfirmation) XXX_Size() int { return xxx_messageInfo_OrderConfirmation.Size(m) @@ -1840,16 +1783,17 @@ func (m *OrderReject) Reset() { *m = OrderReject{} } func (m *OrderReject) String() string { return proto.CompactTextString(m) } func (*OrderReject) ProtoMessage() {} func (*OrderReject) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{4} + return fileDescriptor_b6d125f880f9ca35, []int{4} } + func (m *OrderReject) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderReject.Unmarshal(m, b) } func (m *OrderReject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderReject.Marshal(b, m, deterministic) } -func (dst *OrderReject) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderReject.Merge(dst, src) +func (m *OrderReject) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderReject.Merge(m, src) } func (m *OrderReject) XXX_Size() int { return xxx_messageInfo_OrderReject.Size(m) @@ -1893,16 +1837,17 @@ func (m *RatingSignature) Reset() { *m = RatingSignature{} } func (m *RatingSignature) String() string { return proto.CompactTextString(m) } func (*RatingSignature) ProtoMessage() {} func (*RatingSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{5} + return fileDescriptor_b6d125f880f9ca35, []int{5} } + func (m *RatingSignature) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RatingSignature.Unmarshal(m, b) } func (m *RatingSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RatingSignature.Marshal(b, m, deterministic) } -func (dst *RatingSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_RatingSignature.Merge(dst, src) +func (m *RatingSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_RatingSignature.Merge(m, src) } func (m *RatingSignature) XXX_Size() int { return xxx_messageInfo_RatingSignature.Size(m) @@ -1942,16 +1887,17 @@ func (m *RatingSignature_TransactionMetadata) Reset() { *m = RatingSigna func (m *RatingSignature_TransactionMetadata) String() string { return proto.CompactTextString(m) } func (*RatingSignature_TransactionMetadata) ProtoMessage() {} func (*RatingSignature_TransactionMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{5, 0} + return fileDescriptor_b6d125f880f9ca35, []int{5, 0} } + func (m *RatingSignature_TransactionMetadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RatingSignature_TransactionMetadata.Unmarshal(m, b) } func (m *RatingSignature_TransactionMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RatingSignature_TransactionMetadata.Marshal(b, m, deterministic) } -func (dst *RatingSignature_TransactionMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_RatingSignature_TransactionMetadata.Merge(dst, src) +func (m *RatingSignature_TransactionMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_RatingSignature_TransactionMetadata.Merge(m, src) } func (m *RatingSignature_TransactionMetadata) XXX_Size() int { return xxx_messageInfo_RatingSignature_TransactionMetadata.Size(m) @@ -2014,16 +1960,17 @@ func (m *RatingSignature_TransactionMetadata_Image) Reset() { func (m *RatingSignature_TransactionMetadata_Image) String() string { return proto.CompactTextString(m) } func (*RatingSignature_TransactionMetadata_Image) ProtoMessage() {} func (*RatingSignature_TransactionMetadata_Image) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{5, 0, 0} + return fileDescriptor_b6d125f880f9ca35, []int{5, 0, 0} } + func (m *RatingSignature_TransactionMetadata_Image) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RatingSignature_TransactionMetadata_Image.Unmarshal(m, b) } func (m *RatingSignature_TransactionMetadata_Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RatingSignature_TransactionMetadata_Image.Marshal(b, m, deterministic) } -func (dst *RatingSignature_TransactionMetadata_Image) XXX_Merge(src proto.Message) { - xxx_messageInfo_RatingSignature_TransactionMetadata_Image.Merge(dst, src) +func (m *RatingSignature_TransactionMetadata_Image) XXX_Merge(src proto.Message) { + xxx_messageInfo_RatingSignature_TransactionMetadata_Image.Merge(m, src) } func (m *RatingSignature_TransactionMetadata_Image) XXX_Size() int { return xxx_messageInfo_RatingSignature_TransactionMetadata_Image.Size(m) @@ -2081,16 +2028,17 @@ func (m *BitcoinSignature) Reset() { *m = BitcoinSignature{} } func (m *BitcoinSignature) String() string { return proto.CompactTextString(m) } func (*BitcoinSignature) ProtoMessage() {} func (*BitcoinSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{6} + return fileDescriptor_b6d125f880f9ca35, []int{6} } + func (m *BitcoinSignature) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BitcoinSignature.Unmarshal(m, b) } func (m *BitcoinSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_BitcoinSignature.Marshal(b, m, deterministic) } -func (dst *BitcoinSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_BitcoinSignature.Merge(dst, src) +func (m *BitcoinSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitcoinSignature.Merge(m, src) } func (m *BitcoinSignature) XXX_Size() int { return xxx_messageInfo_BitcoinSignature.Size(m) @@ -2121,7 +2069,7 @@ type OrderFulfillment struct { Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Physical goods only PhysicalDelivery []*OrderFulfillment_PhysicalDelivery `protobuf:"bytes,4,rep,name=physicalDelivery,proto3" json:"physicalDelivery,omitempty"` - // Digital goods only + //Digital goods only DigitalDelivery []*OrderFulfillment_DigitalDelivery `protobuf:"bytes,5,rep,name=digitalDelivery,proto3" json:"digitalDelivery,omitempty"` // Moderated payments only Payout *OrderFulfillment_Payout `protobuf:"bytes,6,opt,name=payout,proto3" json:"payout,omitempty"` @@ -2138,16 +2086,17 @@ func (m *OrderFulfillment) Reset() { *m = OrderFulfillment{} } func (m *OrderFulfillment) String() string { return proto.CompactTextString(m) } func (*OrderFulfillment) ProtoMessage() {} func (*OrderFulfillment) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{7} + return fileDescriptor_b6d125f880f9ca35, []int{7} } + func (m *OrderFulfillment) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderFulfillment.Unmarshal(m, b) } func (m *OrderFulfillment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderFulfillment.Marshal(b, m, deterministic) } -func (dst *OrderFulfillment) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderFulfillment.Merge(dst, src) +func (m *OrderFulfillment) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderFulfillment.Merge(m, src) } func (m *OrderFulfillment) XXX_Size() int { return xxx_messageInfo_OrderFulfillment.Size(m) @@ -2233,16 +2182,17 @@ func (m *OrderFulfillment_PhysicalDelivery) Reset() { *m = OrderFulfillm func (m *OrderFulfillment_PhysicalDelivery) String() string { return proto.CompactTextString(m) } func (*OrderFulfillment_PhysicalDelivery) ProtoMessage() {} func (*OrderFulfillment_PhysicalDelivery) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{7, 0} + return fileDescriptor_b6d125f880f9ca35, []int{7, 0} } + func (m *OrderFulfillment_PhysicalDelivery) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderFulfillment_PhysicalDelivery.Unmarshal(m, b) } func (m *OrderFulfillment_PhysicalDelivery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderFulfillment_PhysicalDelivery.Marshal(b, m, deterministic) } -func (dst *OrderFulfillment_PhysicalDelivery) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderFulfillment_PhysicalDelivery.Merge(dst, src) +func (m *OrderFulfillment_PhysicalDelivery) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderFulfillment_PhysicalDelivery.Merge(m, src) } func (m *OrderFulfillment_PhysicalDelivery) XXX_Size() int { return xxx_messageInfo_OrderFulfillment_PhysicalDelivery.Size(m) @@ -2279,16 +2229,17 @@ func (m *OrderFulfillment_DigitalDelivery) Reset() { *m = OrderFulfillme func (m *OrderFulfillment_DigitalDelivery) String() string { return proto.CompactTextString(m) } func (*OrderFulfillment_DigitalDelivery) ProtoMessage() {} func (*OrderFulfillment_DigitalDelivery) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{7, 1} + return fileDescriptor_b6d125f880f9ca35, []int{7, 1} } + func (m *OrderFulfillment_DigitalDelivery) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderFulfillment_DigitalDelivery.Unmarshal(m, b) } func (m *OrderFulfillment_DigitalDelivery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderFulfillment_DigitalDelivery.Marshal(b, m, deterministic) } -func (dst *OrderFulfillment_DigitalDelivery) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderFulfillment_DigitalDelivery.Merge(dst, src) +func (m *OrderFulfillment_DigitalDelivery) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderFulfillment_DigitalDelivery.Merge(m, src) } func (m *OrderFulfillment_DigitalDelivery) XXX_Size() int { return xxx_messageInfo_OrderFulfillment_DigitalDelivery.Size(m) @@ -2326,16 +2277,17 @@ func (m *OrderFulfillment_CryptocurrencyDelivery) Reset() { func (m *OrderFulfillment_CryptocurrencyDelivery) String() string { return proto.CompactTextString(m) } func (*OrderFulfillment_CryptocurrencyDelivery) ProtoMessage() {} func (*OrderFulfillment_CryptocurrencyDelivery) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{7, 2} + return fileDescriptor_b6d125f880f9ca35, []int{7, 2} } + func (m *OrderFulfillment_CryptocurrencyDelivery) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderFulfillment_CryptocurrencyDelivery.Unmarshal(m, b) } func (m *OrderFulfillment_CryptocurrencyDelivery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderFulfillment_CryptocurrencyDelivery.Marshal(b, m, deterministic) } -func (dst *OrderFulfillment_CryptocurrencyDelivery) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderFulfillment_CryptocurrencyDelivery.Merge(dst, src) +func (m *OrderFulfillment_CryptocurrencyDelivery) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderFulfillment_CryptocurrencyDelivery.Merge(m, src) } func (m *OrderFulfillment_CryptocurrencyDelivery) XXX_Size() int { return xxx_messageInfo_OrderFulfillment_CryptocurrencyDelivery.Size(m) @@ -2366,16 +2318,17 @@ func (m *OrderFulfillment_Payout) Reset() { *m = OrderFulfillment_Payout func (m *OrderFulfillment_Payout) String() string { return proto.CompactTextString(m) } func (*OrderFulfillment_Payout) ProtoMessage() {} func (*OrderFulfillment_Payout) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{7, 3} + return fileDescriptor_b6d125f880f9ca35, []int{7, 3} } + func (m *OrderFulfillment_Payout) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderFulfillment_Payout.Unmarshal(m, b) } func (m *OrderFulfillment_Payout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderFulfillment_Payout.Marshal(b, m, deterministic) } -func (dst *OrderFulfillment_Payout) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderFulfillment_Payout.Merge(dst, src) +func (m *OrderFulfillment_Payout) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderFulfillment_Payout.Merge(m, src) } func (m *OrderFulfillment_Payout) XXX_Size() int { return xxx_messageInfo_OrderFulfillment_Payout.Size(m) @@ -2421,16 +2374,17 @@ func (m *OrderCompletion) Reset() { *m = OrderCompletion{} } func (m *OrderCompletion) String() string { return proto.CompactTextString(m) } func (*OrderCompletion) ProtoMessage() {} func (*OrderCompletion) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{8} + return fileDescriptor_b6d125f880f9ca35, []int{8} } + func (m *OrderCompletion) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderCompletion.Unmarshal(m, b) } func (m *OrderCompletion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderCompletion.Marshal(b, m, deterministic) } -func (dst *OrderCompletion) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderCompletion.Merge(dst, src) +func (m *OrderCompletion) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderCompletion.Merge(m, src) } func (m *OrderCompletion) XXX_Size() int { return xxx_messageInfo_OrderCompletion.Size(m) @@ -2481,16 +2435,17 @@ func (m *Rating) Reset() { *m = Rating{} } func (m *Rating) String() string { return proto.CompactTextString(m) } func (*Rating) ProtoMessage() {} func (*Rating) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{9} + return fileDescriptor_b6d125f880f9ca35, []int{9} } + func (m *Rating) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Rating.Unmarshal(m, b) } func (m *Rating) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Rating.Marshal(b, m, deterministic) } -func (dst *Rating) XXX_Merge(src proto.Message) { - xxx_messageInfo_Rating.Merge(dst, src) +func (m *Rating) XXX_Merge(src proto.Message) { + xxx_messageInfo_Rating.Merge(m, src) } func (m *Rating) XXX_Size() int { return xxx_messageInfo_Rating.Size(m) @@ -2539,16 +2494,17 @@ func (m *Rating_RatingData) Reset() { *m = Rating_RatingData{} } func (m *Rating_RatingData) String() string { return proto.CompactTextString(m) } func (*Rating_RatingData) ProtoMessage() {} func (*Rating_RatingData) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{9, 0} + return fileDescriptor_b6d125f880f9ca35, []int{9, 0} } + func (m *Rating_RatingData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Rating_RatingData.Unmarshal(m, b) } func (m *Rating_RatingData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Rating_RatingData.Marshal(b, m, deterministic) } -func (dst *Rating_RatingData) XXX_Merge(src proto.Message) { - xxx_messageInfo_Rating_RatingData.Merge(dst, src) +func (m *Rating_RatingData) XXX_Merge(src proto.Message) { + xxx_messageInfo_Rating_RatingData.Merge(m, src) } func (m *Rating_RatingData) XXX_Size() int { return xxx_messageInfo_Rating_RatingData.Size(m) @@ -2672,16 +2628,17 @@ func (m *Dispute) Reset() { *m = Dispute{} } func (m *Dispute) String() string { return proto.CompactTextString(m) } func (*Dispute) ProtoMessage() {} func (*Dispute) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{10} + return fileDescriptor_b6d125f880f9ca35, []int{10} } + func (m *Dispute) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Dispute.Unmarshal(m, b) } func (m *Dispute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Dispute.Marshal(b, m, deterministic) } -func (dst *Dispute) XXX_Merge(src proto.Message) { - xxx_messageInfo_Dispute.Merge(dst, src) +func (m *Dispute) XXX_Merge(src proto.Message) { + xxx_messageInfo_Dispute.Merge(m, src) } func (m *Dispute) XXX_Size() int { return xxx_messageInfo_Dispute.Size(m) @@ -2743,16 +2700,17 @@ func (m *DisputeResolution) Reset() { *m = DisputeResolution{} } func (m *DisputeResolution) String() string { return proto.CompactTextString(m) } func (*DisputeResolution) ProtoMessage() {} func (*DisputeResolution) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{11} + return fileDescriptor_b6d125f880f9ca35, []int{11} } + func (m *DisputeResolution) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DisputeResolution.Unmarshal(m, b) } func (m *DisputeResolution) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DisputeResolution.Marshal(b, m, deterministic) } -func (dst *DisputeResolution) XXX_Merge(src proto.Message) { - xxx_messageInfo_DisputeResolution.Merge(dst, src) +func (m *DisputeResolution) XXX_Merge(src proto.Message) { + xxx_messageInfo_DisputeResolution.Merge(m, src) } func (m *DisputeResolution) XXX_Size() int { return xxx_messageInfo_DisputeResolution.Size(m) @@ -2820,16 +2778,17 @@ func (m *DisputeResolution_Payout) Reset() { *m = DisputeResolution_Payo func (m *DisputeResolution_Payout) String() string { return proto.CompactTextString(m) } func (*DisputeResolution_Payout) ProtoMessage() {} func (*DisputeResolution_Payout) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{11, 0} + return fileDescriptor_b6d125f880f9ca35, []int{11, 0} } + func (m *DisputeResolution_Payout) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DisputeResolution_Payout.Unmarshal(m, b) } func (m *DisputeResolution_Payout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DisputeResolution_Payout.Marshal(b, m, deterministic) } -func (dst *DisputeResolution_Payout) XXX_Merge(src proto.Message) { - xxx_messageInfo_DisputeResolution_Payout.Merge(dst, src) +func (m *DisputeResolution_Payout) XXX_Merge(src proto.Message) { + xxx_messageInfo_DisputeResolution_Payout.Merge(m, src) } func (m *DisputeResolution_Payout) XXX_Size() int { return xxx_messageInfo_DisputeResolution_Payout.Size(m) @@ -2890,16 +2849,17 @@ func (m *DisputeResolution_Payout_Output) Reset() { *m = DisputeResoluti func (m *DisputeResolution_Payout_Output) String() string { return proto.CompactTextString(m) } func (*DisputeResolution_Payout_Output) ProtoMessage() {} func (*DisputeResolution_Payout_Output) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{11, 0, 0} + return fileDescriptor_b6d125f880f9ca35, []int{11, 0, 0} } + func (m *DisputeResolution_Payout_Output) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DisputeResolution_Payout_Output.Unmarshal(m, b) } func (m *DisputeResolution_Payout_Output) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DisputeResolution_Payout_Output.Marshal(b, m, deterministic) } -func (dst *DisputeResolution_Payout_Output) XXX_Merge(src proto.Message) { - xxx_messageInfo_DisputeResolution_Payout_Output.Merge(dst, src) +func (m *DisputeResolution_Payout_Output) XXX_Merge(src proto.Message) { + xxx_messageInfo_DisputeResolution_Payout_Output.Merge(m, src) } func (m *DisputeResolution_Payout_Output) XXX_Size() int { return xxx_messageInfo_DisputeResolution_Payout_Output.Size(m) @@ -2917,11 +2877,13 @@ type isDisputeResolution_Payout_Output_ScriptOrAddress interface { type DisputeResolution_Payout_Output_Script struct { Script string `protobuf:"bytes,1,opt,name=script,proto3,oneof"` } + type DisputeResolution_Payout_Output_Address struct { Address string `protobuf:"bytes,3,opt,name=address,proto3,oneof"` } -func (*DisputeResolution_Payout_Output_Script) isDisputeResolution_Payout_Output_ScriptOrAddress() {} +func (*DisputeResolution_Payout_Output_Script) isDisputeResolution_Payout_Output_ScriptOrAddress() {} + func (*DisputeResolution_Payout_Output_Address) isDisputeResolution_Payout_Output_ScriptOrAddress() {} func (m *DisputeResolution_Payout_Output) GetScriptOrAddress() isDisputeResolution_Payout_Output_ScriptOrAddress { @@ -2952,72 +2914,14 @@ func (m *DisputeResolution_Payout_Output) GetAmount() uint64 { return 0 } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*DisputeResolution_Payout_Output) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _DisputeResolution_Payout_Output_OneofMarshaler, _DisputeResolution_Payout_Output_OneofUnmarshaler, _DisputeResolution_Payout_Output_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*DisputeResolution_Payout_Output) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*DisputeResolution_Payout_Output_Script)(nil), (*DisputeResolution_Payout_Output_Address)(nil), } } -func _DisputeResolution_Payout_Output_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*DisputeResolution_Payout_Output) - // scriptOrAddress - switch x := m.ScriptOrAddress.(type) { - case *DisputeResolution_Payout_Output_Script: - b.EncodeVarint(1<<3 | proto.WireBytes) - b.EncodeStringBytes(x.Script) - case *DisputeResolution_Payout_Output_Address: - b.EncodeVarint(3<<3 | proto.WireBytes) - b.EncodeStringBytes(x.Address) - case nil: - default: - return fmt.Errorf("DisputeResolution_Payout_Output.ScriptOrAddress has unexpected type %T", x) - } - return nil -} - -func _DisputeResolution_Payout_Output_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*DisputeResolution_Payout_Output) - switch tag { - case 1: // scriptOrAddress.script - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.ScriptOrAddress = &DisputeResolution_Payout_Output_Script{x} - return true, err - case 3: // scriptOrAddress.address - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.ScriptOrAddress = &DisputeResolution_Payout_Output_Address{x} - return true, err - default: - return false, nil - } -} - -func _DisputeResolution_Payout_Output_OneofSizer(msg proto.Message) (n int) { - m := msg.(*DisputeResolution_Payout_Output) - // scriptOrAddress - switch x := m.ScriptOrAddress.(type) { - case *DisputeResolution_Payout_Output_Script: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Script))) - n += len(x.Script) - case *DisputeResolution_Payout_Output_Address: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Address))) - n += len(x.Address) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type DisputeAcceptance struct { Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` ClosedBy string `protobuf:"bytes,2,opt,name=closedBy,proto3" json:"closedBy,omitempty"` @@ -3030,16 +2934,17 @@ func (m *DisputeAcceptance) Reset() { *m = DisputeAcceptance{} } func (m *DisputeAcceptance) String() string { return proto.CompactTextString(m) } func (*DisputeAcceptance) ProtoMessage() {} func (*DisputeAcceptance) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{12} + return fileDescriptor_b6d125f880f9ca35, []int{12} } + func (m *DisputeAcceptance) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DisputeAcceptance.Unmarshal(m, b) } func (m *DisputeAcceptance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DisputeAcceptance.Marshal(b, m, deterministic) } -func (dst *DisputeAcceptance) XXX_Merge(src proto.Message) { - xxx_messageInfo_DisputeAcceptance.Merge(dst, src) +func (m *DisputeAcceptance) XXX_Merge(src proto.Message) { + xxx_messageInfo_DisputeAcceptance.Merge(m, src) } func (m *DisputeAcceptance) XXX_Size() int { return xxx_messageInfo_DisputeAcceptance.Size(m) @@ -3077,16 +2982,17 @@ func (m *Outpoint) Reset() { *m = Outpoint{} } func (m *Outpoint) String() string { return proto.CompactTextString(m) } func (*Outpoint) ProtoMessage() {} func (*Outpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{13} + return fileDescriptor_b6d125f880f9ca35, []int{13} } + func (m *Outpoint) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Outpoint.Unmarshal(m, b) } func (m *Outpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Outpoint.Marshal(b, m, deterministic) } -func (dst *Outpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_Outpoint.Merge(dst, src) +func (m *Outpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_Outpoint.Merge(m, src) } func (m *Outpoint) XXX_Size() int { return xxx_messageInfo_Outpoint.Size(m) @@ -3133,16 +3039,17 @@ func (m *Refund) Reset() { *m = Refund{} } func (m *Refund) String() string { return proto.CompactTextString(m) } func (*Refund) ProtoMessage() {} func (*Refund) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{14} + return fileDescriptor_b6d125f880f9ca35, []int{14} } + func (m *Refund) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Refund.Unmarshal(m, b) } func (m *Refund) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Refund.Marshal(b, m, deterministic) } -func (dst *Refund) XXX_Merge(src proto.Message) { - xxx_messageInfo_Refund.Merge(dst, src) +func (m *Refund) XXX_Merge(src proto.Message) { + xxx_messageInfo_Refund.Merge(m, src) } func (m *Refund) XXX_Size() int { return xxx_messageInfo_Refund.Size(m) @@ -3200,16 +3107,17 @@ func (m *Refund_TransactionInfo) Reset() { *m = Refund_TransactionInfo{} func (m *Refund_TransactionInfo) String() string { return proto.CompactTextString(m) } func (*Refund_TransactionInfo) ProtoMessage() {} func (*Refund_TransactionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{14, 0} + return fileDescriptor_b6d125f880f9ca35, []int{14, 0} } + func (m *Refund_TransactionInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Refund_TransactionInfo.Unmarshal(m, b) } func (m *Refund_TransactionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Refund_TransactionInfo.Marshal(b, m, deterministic) } -func (dst *Refund_TransactionInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_Refund_TransactionInfo.Merge(dst, src) +func (m *Refund_TransactionInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_Refund_TransactionInfo.Merge(m, src) } func (m *Refund_TransactionInfo) XXX_Size() int { return xxx_messageInfo_Refund_TransactionInfo.Size(m) @@ -3245,16 +3153,17 @@ func (m *VendorFinalizedPayment) Reset() { *m = VendorFinalizedPayment{} func (m *VendorFinalizedPayment) String() string { return proto.CompactTextString(m) } func (*VendorFinalizedPayment) ProtoMessage() {} func (*VendorFinalizedPayment) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{15} + return fileDescriptor_b6d125f880f9ca35, []int{15} } + func (m *VendorFinalizedPayment) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VendorFinalizedPayment.Unmarshal(m, b) } func (m *VendorFinalizedPayment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VendorFinalizedPayment.Marshal(b, m, deterministic) } -func (dst *VendorFinalizedPayment) XXX_Merge(src proto.Message) { - xxx_messageInfo_VendorFinalizedPayment.Merge(dst, src) +func (m *VendorFinalizedPayment) XXX_Merge(src proto.Message) { + xxx_messageInfo_VendorFinalizedPayment.Merge(m, src) } func (m *VendorFinalizedPayment) XXX_Size() int { return xxx_messageInfo_VendorFinalizedPayment.Size(m) @@ -3286,16 +3195,17 @@ func (m *ID) Reset() { *m = ID{} } func (m *ID) String() string { return proto.CompactTextString(m) } func (*ID) ProtoMessage() {} func (*ID) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{16} + return fileDescriptor_b6d125f880f9ca35, []int{16} } + func (m *ID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ID.Unmarshal(m, b) } func (m *ID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ID.Marshal(b, m, deterministic) } -func (dst *ID) XXX_Merge(src proto.Message) { - xxx_messageInfo_ID.Merge(dst, src) +func (m *ID) XXX_Merge(src proto.Message) { + xxx_messageInfo_ID.Merge(m, src) } func (m *ID) XXX_Size() int { return xxx_messageInfo_ID.Size(m) @@ -3346,16 +3256,17 @@ func (m *ID_Pubkeys) Reset() { *m = ID_Pubkeys{} } func (m *ID_Pubkeys) String() string { return proto.CompactTextString(m) } func (*ID_Pubkeys) ProtoMessage() {} func (*ID_Pubkeys) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{16, 0} + return fileDescriptor_b6d125f880f9ca35, []int{16, 0} } + func (m *ID_Pubkeys) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ID_Pubkeys.Unmarshal(m, b) } func (m *ID_Pubkeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ID_Pubkeys.Marshal(b, m, deterministic) } -func (dst *ID_Pubkeys) XXX_Merge(src proto.Message) { - xxx_messageInfo_ID_Pubkeys.Merge(dst, src) +func (m *ID_Pubkeys) XXX_Merge(src proto.Message) { + xxx_messageInfo_ID_Pubkeys.Merge(m, src) } func (m *ID_Pubkeys) XXX_Size() int { return xxx_messageInfo_ID_Pubkeys.Size(m) @@ -3392,16 +3303,17 @@ func (m *Signature) Reset() { *m = Signature{} } func (m *Signature) String() string { return proto.CompactTextString(m) } func (*Signature) ProtoMessage() {} func (*Signature) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{17} + return fileDescriptor_b6d125f880f9ca35, []int{17} } + func (m *Signature) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Signature.Unmarshal(m, b) } func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Signature.Marshal(b, m, deterministic) } -func (dst *Signature) XXX_Merge(src proto.Message) { - xxx_messageInfo_Signature.Merge(dst, src) +func (m *Signature) XXX_Merge(src proto.Message) { + xxx_messageInfo_Signature.Merge(m, src) } func (m *Signature) XXX_Size() int { return xxx_messageInfo_Signature.Size(m) @@ -3439,16 +3351,17 @@ func (m *SignedListing) Reset() { *m = SignedListing{} } func (m *SignedListing) String() string { return proto.CompactTextString(m) } func (*SignedListing) ProtoMessage() {} func (*SignedListing) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_c1e9c5924aff92eb, []int{18} + return fileDescriptor_b6d125f880f9ca35, []int{18} } + func (m *SignedListing) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignedListing.Unmarshal(m, b) } func (m *SignedListing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SignedListing.Marshal(b, m, deterministic) } -func (dst *SignedListing) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedListing.Merge(dst, src) +func (m *SignedListing) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedListing.Merge(m, src) } func (m *SignedListing) XXX_Size() int { return xxx_messageInfo_SignedListing.Size(m) @@ -3481,6 +3394,11 @@ func (m *SignedListing) GetSignature() []byte { } func init() { + proto.RegisterEnum("Listing_Metadata_ContractType", Listing_Metadata_ContractType_name, Listing_Metadata_ContractType_value) + proto.RegisterEnum("Listing_Metadata_Format", Listing_Metadata_Format_name, Listing_Metadata_Format_value) + proto.RegisterEnum("Listing_ShippingOption_ShippingType", Listing_ShippingOption_ShippingType_name, Listing_ShippingOption_ShippingType_value) + proto.RegisterEnum("Order_Payment_Method", Order_Payment_Method_name, Order_Payment_Method_value) + proto.RegisterEnum("Signature_Section", Signature_Section_name, Signature_Section_value) proto.RegisterType((*RicardianContract)(nil), "RicardianContract") proto.RegisterType((*Listing)(nil), "Listing") proto.RegisterType((*Listing_Metadata)(nil), "Listing.Metadata") @@ -3526,16 +3444,11 @@ func init() { proto.RegisterType((*ID_Pubkeys)(nil), "ID.Pubkeys") proto.RegisterType((*Signature)(nil), "Signature") proto.RegisterType((*SignedListing)(nil), "SignedListing") - proto.RegisterEnum("Listing_Metadata_ContractType", Listing_Metadata_ContractType_name, Listing_Metadata_ContractType_value) - proto.RegisterEnum("Listing_Metadata_Format", Listing_Metadata_Format_name, Listing_Metadata_Format_value) - proto.RegisterEnum("Listing_ShippingOption_ShippingType", Listing_ShippingOption_ShippingType_name, Listing_ShippingOption_ShippingType_value) - proto.RegisterEnum("Order_Payment_Method", Order_Payment_Method_name, Order_Payment_Method_value) - proto.RegisterEnum("Signature_Section", Signature_Section_name, Signature_Section_value) } -func init() { proto.RegisterFile("contracts.proto", fileDescriptor_contracts_c1e9c5924aff92eb) } +func init() { proto.RegisterFile("contracts.proto", fileDescriptor_b6d125f880f9ca35) } -var fileDescriptor_contracts_c1e9c5924aff92eb = []byte{ +var fileDescriptor_b6d125f880f9ca35 = []byte{ // 3296 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0xbd, 0x73, 0x1b, 0xd7, 0xb5, 0x17, 0xbe, 0x81, 0x03, 0x90, 0x00, 0xaf, 0x68, 0x19, 0x0f, 0xe3, 0x67, 0x51, 0x3b, 0xb2, diff --git a/pb/countrycodes.pb.go b/pb/countrycodes.pb.go index 848b63be1f..2cbe9d1e80 100644 --- a/pb/countrycodes.pb.go +++ b/pb/countrycodes.pb.go @@ -3,9 +3,11 @@ package pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -16,7 +18,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type CountryCode int32 @@ -541,6 +543,7 @@ var CountryCode_name = map[int32]string{ 507: "SOUTH_AMERICA", 508: "OCEANIA", } + var CountryCode_value = map[string]int32{ "NA": 0, "AFGHANISTAN": 1, @@ -805,17 +808,18 @@ var CountryCode_value = map[string]int32{ func (x CountryCode) String() string { return proto.EnumName(CountryCode_name, int32(x)) } + func (CountryCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_countrycodes_35efbc79bf99ad19, []int{0} + return fileDescriptor_18ecd71e04cfbc43, []int{0} } func init() { proto.RegisterEnum("CountryCode", CountryCode_name, CountryCode_value) } -func init() { proto.RegisterFile("countrycodes.proto", fileDescriptor_countrycodes_35efbc79bf99ad19) } +func init() { proto.RegisterFile("countrycodes.proto", fileDescriptor_18ecd71e04cfbc43) } -var fileDescriptor_countrycodes_35efbc79bf99ad19 = []byte{ +var fileDescriptor_18ecd71e04cfbc43 = []byte{ // 2291 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x57, 0x65, 0xbc, 0x1c, 0xc7, 0x91, 0xbf, 0xd5, 0x93, 0x05, 0x23, 0x2a, 0x8d, 0x65, 0x9d, 0x6d, 0x99, 0xce, 0x77, 0x17, 0x70, diff --git a/pb/message.pb.go b/pb/message.pb.go index 6aad0eb162..e1a61df7eb 100644 --- a/pb/message.pb.go +++ b/pb/message.pb.go @@ -3,11 +3,13 @@ package pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import any "github.com/golang/protobuf/ptypes/any" -import timestamp "github.com/golang/protobuf/ptypes/timestamp" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -18,7 +20,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Message_MessageType int32 @@ -44,6 +46,7 @@ const ( Message_STORE Message_MessageType = 18 Message_BLOCK Message_MessageType = 19 Message_VENDOR_FINALIZED_PAYMENT Message_MessageType = 20 + Message_ORDER_PAYMENT Message_MessageType = 21 Message_ERROR Message_MessageType = 500 ) @@ -69,8 +72,10 @@ var Message_MessageType_name = map[int32]string{ 18: "STORE", 19: "BLOCK", 20: "VENDOR_FINALIZED_PAYMENT", + 21: "ORDER_PAYMENT", 500: "ERROR", } + var Message_MessageType_value = map[string]int32{ "PING": 0, "CHAT": 1, @@ -93,14 +98,16 @@ var Message_MessageType_value = map[string]int32{ "STORE": 18, "BLOCK": 19, "VENDOR_FINALIZED_PAYMENT": 20, + "ORDER_PAYMENT": 21, "ERROR": 500, } func (x Message_MessageType) String() string { return proto.EnumName(Message_MessageType_name, int32(x)) } + func (Message_MessageType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{0, 0} + return fileDescriptor_33c57e4bae7b9afd, []int{0, 0} } type Chat_Flag int32 @@ -116,6 +123,7 @@ var Chat_Flag_name = map[int32]string{ 1: "TYPING", 2: "READ", } + var Chat_Flag_value = map[string]int32{ "MESSAGE": 0, "TYPING": 1, @@ -125,8 +133,9 @@ var Chat_Flag_value = map[string]int32{ func (x Chat_Flag) String() string { return proto.EnumName(Chat_Flag_name, int32(x)) } + func (Chat_Flag) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{2, 0} + return fileDescriptor_33c57e4bae7b9afd, []int{2, 0} } type Message struct { @@ -143,16 +152,17 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{0} + return fileDescriptor_33c57e4bae7b9afd, []int{0} } + func (m *Message) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Message.Unmarshal(m, b) } func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Message.Marshal(b, m, deterministic) } -func (dst *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(dst, src) +func (m *Message) XXX_Merge(src proto.Message) { + xxx_messageInfo_Message.Merge(m, src) } func (m *Message) XXX_Size() int { return xxx_messageInfo_Message.Size(m) @@ -204,16 +214,17 @@ func (m *Envelope) Reset() { *m = Envelope{} } func (m *Envelope) String() string { return proto.CompactTextString(m) } func (*Envelope) ProtoMessage() {} func (*Envelope) Descriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{1} + return fileDescriptor_33c57e4bae7b9afd, []int{1} } + func (m *Envelope) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Envelope.Unmarshal(m, b) } func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Envelope.Marshal(b, m, deterministic) } -func (dst *Envelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_Envelope.Merge(dst, src) +func (m *Envelope) XXX_Merge(src proto.Message) { + xxx_messageInfo_Envelope.Merge(m, src) } func (m *Envelope) XXX_Size() int { return xxx_messageInfo_Envelope.Size(m) @@ -260,16 +271,17 @@ func (m *Chat) Reset() { *m = Chat{} } func (m *Chat) String() string { return proto.CompactTextString(m) } func (*Chat) ProtoMessage() {} func (*Chat) Descriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{2} + return fileDescriptor_33c57e4bae7b9afd, []int{2} } + func (m *Chat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Chat.Unmarshal(m, b) } func (m *Chat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Chat.Marshal(b, m, deterministic) } -func (dst *Chat) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chat.Merge(dst, src) +func (m *Chat) XXX_Merge(src proto.Message) { + xxx_messageInfo_Chat.Merge(m, src) } func (m *Chat) XXX_Size() int { return xxx_messageInfo_Chat.Size(m) @@ -328,16 +340,17 @@ func (m *SignedData) Reset() { *m = SignedData{} } func (m *SignedData) String() string { return proto.CompactTextString(m) } func (*SignedData) ProtoMessage() {} func (*SignedData) Descriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{3} + return fileDescriptor_33c57e4bae7b9afd, []int{3} } + func (m *SignedData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignedData.Unmarshal(m, b) } func (m *SignedData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SignedData.Marshal(b, m, deterministic) } -func (dst *SignedData) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedData.Merge(dst, src) +func (m *SignedData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedData.Merge(m, src) } func (m *SignedData) XXX_Size() int { return xxx_messageInfo_SignedData.Size(m) @@ -382,16 +395,17 @@ func (m *SignedData_Command) Reset() { *m = SignedData_Command{} } func (m *SignedData_Command) String() string { return proto.CompactTextString(m) } func (*SignedData_Command) ProtoMessage() {} func (*SignedData_Command) Descriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{3, 0} + return fileDescriptor_33c57e4bae7b9afd, []int{3, 0} } + func (m *SignedData_Command) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignedData_Command.Unmarshal(m, b) } func (m *SignedData_Command) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SignedData_Command.Marshal(b, m, deterministic) } -func (dst *SignedData_Command) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedData_Command.Merge(dst, src) +func (m *SignedData_Command) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedData_Command.Merge(m, src) } func (m *SignedData_Command) XXX_Size() int { return xxx_messageInfo_SignedData_Command.Size(m) @@ -434,16 +448,17 @@ func (m *CidList) Reset() { *m = CidList{} } func (m *CidList) String() string { return proto.CompactTextString(m) } func (*CidList) ProtoMessage() {} func (*CidList) Descriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{4} + return fileDescriptor_33c57e4bae7b9afd, []int{4} } + func (m *CidList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CidList.Unmarshal(m, b) } func (m *CidList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_CidList.Marshal(b, m, deterministic) } -func (dst *CidList) XXX_Merge(src proto.Message) { - xxx_messageInfo_CidList.Merge(dst, src) +func (m *CidList) XXX_Merge(src proto.Message) { + xxx_messageInfo_CidList.Merge(m, src) } func (m *CidList) XXX_Size() int { return xxx_messageInfo_CidList.Size(m) @@ -473,16 +488,17 @@ func (m *Block) Reset() { *m = Block{} } func (m *Block) String() string { return proto.CompactTextString(m) } func (*Block) ProtoMessage() {} func (*Block) Descriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{5} + return fileDescriptor_33c57e4bae7b9afd, []int{5} } + func (m *Block) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Block.Unmarshal(m, b) } func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Block.Marshal(b, m, deterministic) } -func (dst *Block) XXX_Merge(src proto.Message) { - xxx_messageInfo_Block.Merge(dst, src) +func (m *Block) XXX_Merge(src proto.Message) { + xxx_messageInfo_Block.Merge(m, src) } func (m *Block) XXX_Size() int { return xxx_messageInfo_Block.Size(m) @@ -520,16 +536,17 @@ func (m *Error) Reset() { *m = Error{} } func (m *Error) String() string { return proto.CompactTextString(m) } func (*Error) ProtoMessage() {} func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_message_1df6e446e7f943cb, []int{6} + return fileDescriptor_33c57e4bae7b9afd, []int{6} } + func (m *Error) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Error.Unmarshal(m, b) } func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Error.Marshal(b, m, deterministic) } -func (dst *Error) XXX_Merge(src proto.Message) { - xxx_messageInfo_Error.Merge(dst, src) +func (m *Error) XXX_Merge(src proto.Message) { + xxx_messageInfo_Error.Merge(m, src) } func (m *Error) XXX_Size() int { return xxx_messageInfo_Error.Size(m) @@ -561,7 +578,72 @@ func (m *Error) GetOrderID() string { return "" } +type OrderPaymentTxn struct { + Coin string `protobuf:"bytes,1,opt,name=coin,proto3" json:"coin,omitempty"` + OrderID string `protobuf:"bytes,2,opt,name=orderID,proto3" json:"orderID,omitempty"` + TransactionID string `protobuf:"bytes,3,opt,name=transactionID,proto3" json:"transactionID,omitempty"` + WithInput bool `protobuf:"varint,4,opt,name=withInput,proto3" json:"withInput,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OrderPaymentTxn) Reset() { *m = OrderPaymentTxn{} } +func (m *OrderPaymentTxn) String() string { return proto.CompactTextString(m) } +func (*OrderPaymentTxn) ProtoMessage() {} +func (*OrderPaymentTxn) Descriptor() ([]byte, []int) { + return fileDescriptor_33c57e4bae7b9afd, []int{7} +} + +func (m *OrderPaymentTxn) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OrderPaymentTxn.Unmarshal(m, b) +} +func (m *OrderPaymentTxn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OrderPaymentTxn.Marshal(b, m, deterministic) +} +func (m *OrderPaymentTxn) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderPaymentTxn.Merge(m, src) +} +func (m *OrderPaymentTxn) XXX_Size() int { + return xxx_messageInfo_OrderPaymentTxn.Size(m) +} +func (m *OrderPaymentTxn) XXX_DiscardUnknown() { + xxx_messageInfo_OrderPaymentTxn.DiscardUnknown(m) +} + +var xxx_messageInfo_OrderPaymentTxn proto.InternalMessageInfo + +func (m *OrderPaymentTxn) GetCoin() string { + if m != nil { + return m.Coin + } + return "" +} + +func (m *OrderPaymentTxn) GetOrderID() string { + if m != nil { + return m.OrderID + } + return "" +} + +func (m *OrderPaymentTxn) GetTransactionID() string { + if m != nil { + return m.TransactionID + } + return "" +} + +func (m *OrderPaymentTxn) GetWithInput() bool { + if m != nil { + return m.WithInput + } + return false +} + func init() { + proto.RegisterEnum("Message_MessageType", Message_MessageType_name, Message_MessageType_value) + proto.RegisterEnum("Chat_Flag", Chat_Flag_name, Chat_Flag_value) proto.RegisterType((*Message)(nil), "Message") proto.RegisterType((*Envelope)(nil), "Envelope") proto.RegisterType((*Chat)(nil), "Chat") @@ -570,62 +652,65 @@ func init() { proto.RegisterType((*CidList)(nil), "CidList") proto.RegisterType((*Block)(nil), "Block") proto.RegisterType((*Error)(nil), "Error") - proto.RegisterEnum("Message_MessageType", Message_MessageType_name, Message_MessageType_value) - proto.RegisterEnum("Chat_Flag", Chat_Flag_name, Chat_Flag_value) -} - -func init() { proto.RegisterFile("message.proto", fileDescriptor_message_1df6e446e7f943cb) } - -var fileDescriptor_message_1df6e446e7f943cb = []byte{ - // 787 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x8f, 0x9b, 0x46, - 0x14, 0x0e, 0x36, 0x5e, 0xec, 0x87, 0x77, 0x33, 0x3b, 0xdd, 0x46, 0x74, 0x95, 0xa6, 0x16, 0x87, - 0xca, 0xbd, 0x10, 0x69, 0x23, 0x55, 0xbd, 0xb2, 0x30, 0xa4, 0x34, 0x18, 0xac, 0x31, 0x4e, 0xb5, - 0xb9, 0x58, 0xd8, 0x4c, 0x5c, 0x1a, 0x1b, 0x28, 0xe0, 0x56, 0xee, 0xad, 0x87, 0xfe, 0xa2, 0xfe, - 0x9e, 0xfe, 0x8b, 0x9e, 0xab, 0x6a, 0x86, 0xa1, 0xde, 0x4d, 0xa5, 0x95, 0x7a, 0xe2, 0xbd, 0xef, - 0x7d, 0xbc, 0x79, 0xef, 0x9b, 0x0f, 0xe0, 0x7c, 0xcf, 0xea, 0x3a, 0xd9, 0x32, 0xab, 0xac, 0x8a, - 0xa6, 0xb8, 0xfe, 0x6c, 0x5b, 0x14, 0xdb, 0x1d, 0x7b, 0x29, 0xb2, 0xf5, 0xe1, 0xfd, 0xcb, 0x24, - 0x3f, 0xca, 0xd2, 0x17, 0x1f, 0x97, 0x9a, 0x6c, 0xcf, 0xea, 0x26, 0xd9, 0x97, 0x2d, 0xc1, 0xfc, - 0x43, 0x05, 0x6d, 0xd6, 0x76, 0xc3, 0x5f, 0x83, 0x2e, 0x1b, 0xc7, 0xc7, 0x92, 0x19, 0xca, 0x44, - 0x99, 0x5e, 0xdc, 0x5c, 0x59, 0xb2, 0xdc, 0x3d, 0x79, 0x8d, 0xde, 0x27, 0x62, 0x0b, 0xb4, 0x32, - 0x39, 0xee, 0x8a, 0x24, 0x35, 0x7a, 0x13, 0x65, 0xaa, 0xdf, 0x5c, 0x59, 0xed, 0xb1, 0x56, 0x77, - 0xac, 0x65, 0xe7, 0x47, 0xda, 0x91, 0xf0, 0x73, 0x18, 0x55, 0xec, 0xa7, 0x03, 0xab, 0x1b, 0x3f, - 0x35, 0xfa, 0x13, 0x65, 0x3a, 0xa0, 0x27, 0x00, 0xbf, 0x00, 0xc8, 0x6a, 0xca, 0xea, 0xb2, 0xc8, - 0x6b, 0x66, 0xa8, 0x13, 0x65, 0x3a, 0xa4, 0xf7, 0x10, 0xf3, 0xb7, 0x3e, 0xe8, 0xf7, 0x46, 0xc1, - 0x43, 0x50, 0xe7, 0x7e, 0xf8, 0x1a, 0x3d, 0xe1, 0x91, 0xf3, 0xad, 0x1d, 0x23, 0x05, 0x03, 0x9c, - 0x79, 0x51, 0x10, 0x44, 0xdf, 0xa3, 0x1e, 0x1e, 0xc3, 0x70, 0x19, 0xca, 0xac, 0x8f, 0x47, 0x30, - 0x88, 0xa8, 0x4b, 0x28, 0x52, 0x31, 0x82, 0xb1, 0x08, 0x57, 0x94, 0x7c, 0x47, 0x9c, 0x18, 0x0d, - 0x4e, 0x88, 0x63, 0x87, 0x0e, 0x09, 0xd0, 0x19, 0x7e, 0x06, 0x58, 0x22, 0x51, 0xe8, 0xf9, 0x74, - 0x66, 0xc7, 0x7e, 0x14, 0x22, 0x0d, 0x7f, 0x0a, 0x97, 0x2d, 0xee, 0x2d, 0x03, 0xcf, 0x0f, 0x82, - 0x19, 0x09, 0x63, 0x34, 0xc4, 0x57, 0x80, 0x3a, 0xfa, 0x6c, 0x1e, 0x10, 0x41, 0x1e, 0xf1, 0xb6, - 0xae, 0xbf, 0x98, 0x2f, 0x63, 0xb2, 0x8a, 0xe6, 0x24, 0x44, 0x80, 0x31, 0x5c, 0x74, 0xc8, 0x72, - 0xee, 0xda, 0x31, 0x41, 0x3a, 0xbe, 0x84, 0xf3, 0x0e, 0x73, 0x82, 0x68, 0x41, 0xd0, 0x98, 0xaf, - 0x41, 0x89, 0xb7, 0x0c, 0x5d, 0x74, 0x8e, 0x9f, 0x82, 0x1e, 0x79, 0x5e, 0xe0, 0x87, 0x64, 0x65, - 0x3b, 0x6f, 0xd0, 0x05, 0xe7, 0x77, 0x00, 0x25, 0x81, 0x7d, 0x87, 0x9e, 0x72, 0x68, 0x16, 0xb9, - 0x84, 0xda, 0x71, 0x44, 0x57, 0xb6, 0xeb, 0x22, 0xc4, 0x27, 0x3a, 0x41, 0x94, 0xcc, 0xa2, 0xb7, - 0x04, 0x5d, 0x72, 0x15, 0x16, 0x71, 0x44, 0x09, 0xc2, 0x3c, 0xbc, 0x0d, 0x22, 0xe7, 0x0d, 0xfa, - 0x04, 0x3f, 0x07, 0xe3, 0x2d, 0x09, 0xdd, 0x88, 0xae, 0x3c, 0x3f, 0xb4, 0x03, 0xff, 0x1d, 0x71, - 0x57, 0x73, 0xfb, 0x4e, 0xec, 0x76, 0x85, 0x01, 0x06, 0x84, 0xd2, 0x88, 0xa2, 0xbf, 0xfa, 0x66, - 0x0a, 0x43, 0x92, 0xff, 0xcc, 0x76, 0x45, 0xc9, 0xb0, 0x09, 0x9a, 0x34, 0x83, 0x70, 0x8c, 0x7e, - 0x33, 0xec, 0x9c, 0x42, 0xbb, 0x02, 0x7e, 0x06, 0x67, 0xe5, 0x61, 0xfd, 0x81, 0x1d, 0x85, 0x41, - 0xc6, 0x54, 0x66, 0xdc, 0x09, 0x75, 0xb6, 0xcd, 0x93, 0xe6, 0x50, 0x31, 0xe1, 0x84, 0x31, 0x3d, - 0x01, 0xe6, 0x9f, 0x0a, 0xa8, 0xce, 0x0f, 0x49, 0xc3, 0x69, 0xb2, 0x93, 0x9f, 0x8a, 0x43, 0x46, - 0xf4, 0x04, 0x60, 0x03, 0xb4, 0xfa, 0xb0, 0xfe, 0x91, 0x6d, 0x1a, 0xd1, 0x7d, 0x44, 0xbb, 0x94, - 0x57, 0xba, 0xd1, 0xfa, 0x6d, 0xa5, 0x1b, 0xe8, 0x1b, 0x18, 0xfd, 0xfb, 0x25, 0x08, 0x8f, 0xe9, - 0x37, 0xd7, 0xff, 0x31, 0x6d, 0xdc, 0x31, 0xe8, 0x89, 0x8c, 0x5f, 0x80, 0xfa, 0x7e, 0x97, 0x6c, - 0x8d, 0x81, 0xf8, 0x3a, 0xc0, 0xe2, 0x03, 0x5a, 0xde, 0x2e, 0xd9, 0x52, 0x81, 0x9b, 0x5f, 0x81, - 0xca, 0x33, 0xac, 0x83, 0x36, 0x23, 0x8b, 0x85, 0xfd, 0x9a, 0xa0, 0x27, 0xfc, 0x22, 0xe3, 0x3b, - 0xe1, 0x52, 0x85, 0xbb, 0x94, 0x12, 0xdb, 0x45, 0x3d, 0xf3, 0x6f, 0x05, 0x60, 0x91, 0x6d, 0x73, - 0x96, 0xba, 0x49, 0x93, 0x60, 0x13, 0xc6, 0x35, 0xcb, 0x53, 0x56, 0xcd, 0x5b, 0xa9, 0x14, 0xa1, - 0xc7, 0x03, 0x0c, 0x7f, 0x09, 0x17, 0x35, 0xab, 0xb2, 0x64, 0x97, 0xfd, 0xda, 0xbe, 0x25, 0x05, - 0xfd, 0x08, 0x7d, 0x5c, 0xd8, 0xeb, 0xdf, 0x15, 0xd0, 0x9c, 0x62, 0xbf, 0x4f, 0xf2, 0x54, 0x5c, - 0x0d, 0x63, 0x95, 0xef, 0x4a, 0x61, 0x65, 0x86, 0xa7, 0xa0, 0x36, 0xfc, 0x2f, 0xd0, 0x7b, 0xe4, - 0x2f, 0x20, 0x18, 0x0f, 0xb5, 0xec, 0xff, 0x0f, 0x2d, 0xcd, 0xcf, 0x41, 0x73, 0xb2, 0x34, 0xc8, - 0xea, 0x06, 0x63, 0x50, 0x37, 0x59, 0x5a, 0x1b, 0xca, 0xa4, 0x3f, 0x1d, 0x51, 0x11, 0x9b, 0xaf, - 0x60, 0x70, 0xbb, 0x2b, 0x36, 0x1f, 0xf8, 0x3d, 0x56, 0xc9, 0x2f, 0x62, 0xdd, 0x56, 0x94, 0x2e, - 0xc5, 0x08, 0xfa, 0x9b, 0x2c, 0x95, 0xf7, 0xce, 0x43, 0xf3, 0x0e, 0x06, 0xa4, 0xaa, 0x8a, 0x4a, - 0x74, 0x2c, 0xd2, 0xd6, 0x94, 0xe7, 0x54, 0xc4, 0x5c, 0x62, 0xc6, 0x8b, 0x72, 0x09, 0xf9, 0xde, - 0x03, 0x8c, 0x1f, 0x56, 0x54, 0xa9, 0x50, 0x44, 0x9a, 0x46, 0xa6, 0xb7, 0xea, 0xbb, 0x5e, 0xb9, - 0x5e, 0x9f, 0x89, 0x9d, 0x5e, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x67, 0x2d, 0xb7, 0x8c, 0x85, - 0x05, 0x00, 0x00, + proto.RegisterType((*OrderPaymentTxn)(nil), "OrderPaymentTxn") +} + +func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) } + +var fileDescriptor_33c57e4bae7b9afd = []byte{ + // 852 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xd1, 0x8e, 0xda, 0x46, + 0x14, 0x8d, 0xc1, 0x2c, 0x70, 0x81, 0xdd, 0xd9, 0xe9, 0x26, 0xa2, 0xab, 0x34, 0x45, 0x56, 0x55, + 0xd1, 0x17, 0x22, 0x6d, 0xa4, 0xaa, 0xaf, 0x5e, 0x7b, 0x9c, 0xba, 0x31, 0x36, 0x1a, 0x4c, 0xaa, + 0xcd, 0x0b, 0x1a, 0xf0, 0x84, 0xb8, 0x01, 0xdb, 0xb5, 0x4d, 0x53, 0xfa, 0x5a, 0xf5, 0x0f, 0xfa, + 0x4d, 0xfd, 0x8b, 0xfe, 0x45, 0x9f, 0xab, 0x6a, 0xc6, 0xe3, 0xb0, 0xa4, 0x52, 0xa4, 0x3c, 0x71, + 0xef, 0xb9, 0x87, 0x7b, 0x67, 0xce, 0x3d, 0x1e, 0x18, 0xec, 0x78, 0x51, 0xb0, 0x0d, 0x9f, 0x64, + 0x79, 0x5a, 0xa6, 0xd7, 0x9f, 0x6f, 0xd2, 0x74, 0xb3, 0xe5, 0x4f, 0x65, 0xb6, 0xda, 0xbf, 0x7e, + 0xca, 0x92, 0x83, 0x2a, 0x7d, 0xf9, 0x61, 0xa9, 0x8c, 0x77, 0xbc, 0x28, 0xd9, 0x2e, 0xab, 0x08, + 0xc6, 0x5f, 0x3a, 0xb4, 0xa7, 0x55, 0x37, 0xfc, 0x2d, 0xf4, 0x54, 0xe3, 0xf0, 0x90, 0xf1, 0xa1, + 0x36, 0xd2, 0xc6, 0xe7, 0x37, 0x57, 0x13, 0x55, 0xae, 0x7f, 0x45, 0x8d, 0xde, 0x27, 0xe2, 0x09, + 0xb4, 0x33, 0x76, 0xd8, 0xa6, 0x2c, 0x1a, 0x36, 0x46, 0xda, 0xb8, 0x77, 0x73, 0x35, 0xa9, 0xc6, + 0x4e, 0xea, 0xb1, 0x13, 0x33, 0x39, 0xd0, 0x9a, 0x84, 0x1f, 0x43, 0x37, 0xe7, 0x3f, 0xef, 0x79, + 0x51, 0xba, 0xd1, 0xb0, 0x39, 0xd2, 0xc6, 0x2d, 0x7a, 0x04, 0xf0, 0x13, 0x80, 0xb8, 0xa0, 0xbc, + 0xc8, 0xd2, 0xa4, 0xe0, 0x43, 0x7d, 0xa4, 0x8d, 0x3b, 0xf4, 0x1e, 0x62, 0xfc, 0xd9, 0x84, 0xde, + 0xbd, 0xa3, 0xe0, 0x0e, 0xe8, 0x33, 0xd7, 0x7f, 0x8e, 0x1e, 0x88, 0xc8, 0xfa, 0xde, 0x0c, 0x91, + 0x86, 0x01, 0xce, 0x9c, 0xc0, 0xf3, 0x82, 0x1f, 0x51, 0x03, 0xf7, 0xa1, 0xb3, 0xf0, 0x55, 0xd6, + 0xc4, 0x5d, 0x68, 0x05, 0xd4, 0x26, 0x14, 0xe9, 0x18, 0x41, 0x5f, 0x86, 0x4b, 0x4a, 0x7e, 0x20, + 0x56, 0x88, 0x5a, 0x47, 0xc4, 0x32, 0x7d, 0x8b, 0x78, 0xe8, 0x0c, 0x3f, 0x02, 0xac, 0x90, 0xc0, + 0x77, 0x5c, 0x3a, 0x35, 0x43, 0x37, 0xf0, 0x51, 0x1b, 0x3f, 0x84, 0xcb, 0x0a, 0x77, 0x16, 0x9e, + 0xe3, 0x7a, 0xde, 0x94, 0xf8, 0x21, 0xea, 0xe0, 0x2b, 0x40, 0x35, 0x7d, 0x3a, 0xf3, 0x88, 0x24, + 0x77, 0x45, 0x5b, 0xdb, 0x9d, 0xcf, 0x16, 0x21, 0x59, 0x06, 0x33, 0xe2, 0x23, 0xc0, 0x18, 0xce, + 0x6b, 0x64, 0x31, 0xb3, 0xcd, 0x90, 0xa0, 0x1e, 0xbe, 0x84, 0x41, 0x8d, 0x59, 0x5e, 0x30, 0x27, + 0xa8, 0x2f, 0xae, 0x41, 0x89, 0xb3, 0xf0, 0x6d, 0x34, 0xc0, 0x17, 0xd0, 0x0b, 0x1c, 0xc7, 0x73, + 0x7d, 0xb2, 0x34, 0xad, 0x17, 0xe8, 0x5c, 0xf0, 0x6b, 0x80, 0x12, 0xcf, 0xbc, 0x43, 0x17, 0x02, + 0x9a, 0x06, 0x36, 0xa1, 0x66, 0x18, 0xd0, 0xa5, 0x69, 0xdb, 0x08, 0x89, 0x13, 0x1d, 0x21, 0x4a, + 0xa6, 0xc1, 0x4b, 0x82, 0x2e, 0x85, 0x0a, 0xf3, 0x30, 0xa0, 0x04, 0x61, 0x11, 0xde, 0x7a, 0x81, + 0xf5, 0x02, 0x7d, 0x86, 0x1f, 0xc3, 0xf0, 0x25, 0xf1, 0xed, 0x80, 0x2e, 0x1d, 0xd7, 0x37, 0x3d, + 0xf7, 0x15, 0xb1, 0x97, 0x33, 0xf3, 0x4e, 0xde, 0xed, 0x4a, 0xce, 0x93, 0x77, 0xab, 0xa1, 0x87, + 0x18, 0xa0, 0x45, 0x28, 0x0d, 0x28, 0xfa, 0xa7, 0x69, 0x44, 0xd0, 0x21, 0xc9, 0x2f, 0x7c, 0x9b, + 0x66, 0x1c, 0x1b, 0xd0, 0x56, 0xfe, 0x90, 0x26, 0xea, 0xdd, 0x74, 0x6a, 0xf3, 0xd0, 0xba, 0x80, + 0x1f, 0xc1, 0x59, 0xb6, 0x5f, 0xbd, 0xe5, 0x07, 0xe9, 0x99, 0x3e, 0x55, 0x99, 0x30, 0x47, 0x11, + 0x6f, 0x12, 0x56, 0xee, 0x73, 0x2e, 0xcd, 0xd1, 0xa7, 0x47, 0xc0, 0xf8, 0x5b, 0x03, 0xdd, 0x7a, + 0xc3, 0x4a, 0x41, 0x53, 0x9d, 0xdc, 0x48, 0x0e, 0xe9, 0xd2, 0x23, 0x80, 0x87, 0xd0, 0x2e, 0xf6, + 0xab, 0x9f, 0xf8, 0xba, 0x94, 0xdd, 0xbb, 0xb4, 0x4e, 0x45, 0xa5, 0x3e, 0x5a, 0xb3, 0xaa, 0xd4, + 0x07, 0xfa, 0x0e, 0xba, 0xef, 0x3f, 0x0e, 0x69, 0xbb, 0xde, 0xcd, 0xf5, 0xff, 0x7c, 0x1c, 0xd6, + 0x0c, 0x7a, 0x24, 0xe3, 0x27, 0xa0, 0xbf, 0xde, 0xb2, 0xcd, 0xb0, 0x25, 0x3f, 0x18, 0x98, 0x88, + 0x03, 0x4e, 0x9c, 0x2d, 0xdb, 0x50, 0x89, 0x1b, 0xdf, 0x80, 0x2e, 0x32, 0xdc, 0x83, 0xf6, 0x94, + 0xcc, 0xe7, 0xe6, 0x73, 0x82, 0x1e, 0x88, 0xdd, 0x86, 0x77, 0xd2, 0xb8, 0x9a, 0x30, 0x2e, 0x25, + 0xa6, 0x8d, 0x1a, 0xc6, 0xbf, 0x1a, 0xc0, 0x3c, 0xde, 0x24, 0x3c, 0xb2, 0x59, 0xc9, 0xb0, 0x01, + 0xfd, 0x82, 0x27, 0x11, 0xcf, 0x67, 0x95, 0x54, 0x9a, 0xd4, 0xe3, 0x04, 0xc3, 0x5f, 0xc3, 0x79, + 0xc1, 0xf3, 0x98, 0x6d, 0xe3, 0xdf, 0xaa, 0x7f, 0x29, 0x41, 0x3f, 0x40, 0x3f, 0x2e, 0xec, 0xf5, + 0x1f, 0x1a, 0xb4, 0xad, 0x74, 0xb7, 0x63, 0x49, 0x24, 0x57, 0xc3, 0x79, 0xee, 0xda, 0x4a, 0x58, + 0x95, 0xe1, 0x31, 0xe8, 0xa5, 0x78, 0x18, 0x1a, 0x1f, 0x79, 0x18, 0x24, 0xe3, 0x54, 0xcb, 0xe6, + 0x27, 0x68, 0x69, 0x7c, 0x01, 0x6d, 0x2b, 0x8e, 0xbc, 0xb8, 0x28, 0x31, 0x06, 0x7d, 0x1d, 0x47, + 0xc5, 0x50, 0x1b, 0x35, 0xc7, 0x5d, 0x2a, 0x63, 0xe3, 0x19, 0xb4, 0x6e, 0xb7, 0xe9, 0xfa, 0xad, + 0xd8, 0x63, 0xce, 0xde, 0xc9, 0xeb, 0x56, 0xa2, 0xd4, 0x29, 0x46, 0xd0, 0x5c, 0xc7, 0x91, 0xda, + 0xbb, 0x08, 0x8d, 0x3b, 0x68, 0x91, 0x3c, 0x4f, 0x73, 0xd9, 0x31, 0x8d, 0x2a, 0x53, 0x0e, 0xa8, + 0x8c, 0x85, 0xc4, 0x5c, 0x14, 0xd5, 0x25, 0xd4, 0xff, 0x4e, 0x30, 0x31, 0x2c, 0xcd, 0x23, 0xa9, + 0x88, 0x32, 0x8d, 0x4a, 0x8d, 0xdf, 0x35, 0xb8, 0x08, 0x44, 0x3c, 0x63, 0x87, 0x1d, 0x4f, 0xca, + 0xf0, 0xd7, 0xa4, 0x9a, 0x12, 0x27, 0x4a, 0x3c, 0x19, 0xdf, 0xef, 0xd0, 0x38, 0xe9, 0x80, 0xbf, + 0x82, 0x41, 0x99, 0xb3, 0xa4, 0x60, 0xeb, 0x32, 0x4e, 0x93, 0xf7, 0x13, 0x4e, 0x41, 0xb1, 0xbc, + 0x77, 0x71, 0xf9, 0xc6, 0x4d, 0xb2, 0x7d, 0xa9, 0xde, 0xc4, 0x23, 0x70, 0xab, 0xbf, 0x6a, 0x64, + 0xab, 0xd5, 0x99, 0x54, 0xf6, 0xd9, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x4e, 0x95, 0x05, + 0x1e, 0x06, 0x00, 0x00, } diff --git a/pb/moderator.pb.go b/pb/moderator.pb.go index 8abf8f24d8..91066c2968 100644 --- a/pb/moderator.pb.go +++ b/pb/moderator.pb.go @@ -3,9 +3,11 @@ package pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -16,7 +18,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Moderator_Fee_FeeType int32 @@ -31,6 +33,7 @@ var Moderator_Fee_FeeType_name = map[int32]string{ 1: "PERCENTAGE", 2: "FIXED_PLUS_PERCENTAGE", } + var Moderator_Fee_FeeType_value = map[string]int32{ "FIXED": 0, "PERCENTAGE": 1, @@ -40,8 +43,9 @@ var Moderator_Fee_FeeType_value = map[string]int32{ func (x Moderator_Fee_FeeType) String() string { return proto.EnumName(Moderator_Fee_FeeType_name, int32(x)) } + func (Moderator_Fee_FeeType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_moderator_30fcf04c353ab1b7, []int{0, 0, 0} + return fileDescriptor_44f20453d9230215, []int{0, 0, 0} } type Moderator struct { @@ -59,16 +63,17 @@ func (m *Moderator) Reset() { *m = Moderator{} } func (m *Moderator) String() string { return proto.CompactTextString(m) } func (*Moderator) ProtoMessage() {} func (*Moderator) Descriptor() ([]byte, []int) { - return fileDescriptor_moderator_30fcf04c353ab1b7, []int{0} + return fileDescriptor_44f20453d9230215, []int{0} } + func (m *Moderator) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Moderator.Unmarshal(m, b) } func (m *Moderator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Moderator.Marshal(b, m, deterministic) } -func (dst *Moderator) XXX_Merge(src proto.Message) { - xxx_messageInfo_Moderator.Merge(dst, src) +func (m *Moderator) XXX_Merge(src proto.Message) { + xxx_messageInfo_Moderator.Merge(m, src) } func (m *Moderator) XXX_Size() int { return xxx_messageInfo_Moderator.Size(m) @@ -127,16 +132,17 @@ func (m *Moderator_Fee) Reset() { *m = Moderator_Fee{} } func (m *Moderator_Fee) String() string { return proto.CompactTextString(m) } func (*Moderator_Fee) ProtoMessage() {} func (*Moderator_Fee) Descriptor() ([]byte, []int) { - return fileDescriptor_moderator_30fcf04c353ab1b7, []int{0, 0} + return fileDescriptor_44f20453d9230215, []int{0, 0} } + func (m *Moderator_Fee) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Moderator_Fee.Unmarshal(m, b) } func (m *Moderator_Fee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Moderator_Fee.Marshal(b, m, deterministic) } -func (dst *Moderator_Fee) XXX_Merge(src proto.Message) { - xxx_messageInfo_Moderator_Fee.Merge(dst, src) +func (m *Moderator_Fee) XXX_Merge(src proto.Message) { + xxx_messageInfo_Moderator_Fee.Merge(m, src) } func (m *Moderator_Fee) XXX_Size() int { return xxx_messageInfo_Moderator_Fee.Size(m) @@ -180,16 +186,17 @@ func (m *Moderator_Price) Reset() { *m = Moderator_Price{} } func (m *Moderator_Price) String() string { return proto.CompactTextString(m) } func (*Moderator_Price) ProtoMessage() {} func (*Moderator_Price) Descriptor() ([]byte, []int) { - return fileDescriptor_moderator_30fcf04c353ab1b7, []int{0, 1} + return fileDescriptor_44f20453d9230215, []int{0, 1} } + func (m *Moderator_Price) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Moderator_Price.Unmarshal(m, b) } func (m *Moderator_Price) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Moderator_Price.Marshal(b, m, deterministic) } -func (dst *Moderator_Price) XXX_Merge(src proto.Message) { - xxx_messageInfo_Moderator_Price.Merge(dst, src) +func (m *Moderator_Price) XXX_Merge(src proto.Message) { + xxx_messageInfo_Moderator_Price.Merge(m, src) } func (m *Moderator_Price) XXX_Size() int { return xxx_messageInfo_Moderator_Price.Size(m) @@ -228,16 +235,17 @@ func (m *DisputeUpdate) Reset() { *m = DisputeUpdate{} } func (m *DisputeUpdate) String() string { return proto.CompactTextString(m) } func (*DisputeUpdate) ProtoMessage() {} func (*DisputeUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_moderator_30fcf04c353ab1b7, []int{1} + return fileDescriptor_44f20453d9230215, []int{1} } + func (m *DisputeUpdate) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DisputeUpdate.Unmarshal(m, b) } func (m *DisputeUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DisputeUpdate.Marshal(b, m, deterministic) } -func (dst *DisputeUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_DisputeUpdate.Merge(dst, src) +func (m *DisputeUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_DisputeUpdate.Merge(m, src) } func (m *DisputeUpdate) XXX_Size() int { return xxx_messageInfo_DisputeUpdate.Size(m) @@ -277,16 +285,16 @@ func (m *DisputeUpdate) GetSerializedContract() []byte { } func init() { + proto.RegisterEnum("Moderator_Fee_FeeType", Moderator_Fee_FeeType_name, Moderator_Fee_FeeType_value) proto.RegisterType((*Moderator)(nil), "Moderator") proto.RegisterType((*Moderator_Fee)(nil), "Moderator.Fee") proto.RegisterType((*Moderator_Price)(nil), "Moderator.Price") proto.RegisterType((*DisputeUpdate)(nil), "DisputeUpdate") - proto.RegisterEnum("Moderator_Fee_FeeType", Moderator_Fee_FeeType_name, Moderator_Fee_FeeType_value) } -func init() { proto.RegisterFile("moderator.proto", fileDescriptor_moderator_30fcf04c353ab1b7) } +func init() { proto.RegisterFile("moderator.proto", fileDescriptor_44f20453d9230215) } -var fileDescriptor_moderator_30fcf04c353ab1b7 = []byte{ +var fileDescriptor_44f20453d9230215 = []byte{ // 429 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xdf, 0x6a, 0xdb, 0x30, 0x14, 0x87, 0xe7, 0x38, 0x69, 0xe6, 0x93, 0x36, 0x0d, 0x82, 0x15, 0x2f, 0x8c, 0x61, 0xc2, 0x60, diff --git a/pb/orders.pb.go b/pb/orders.pb.go index 89520fedbc..095d2bd9c2 100644 --- a/pb/orders.pb.go +++ b/pb/orders.pb.go @@ -3,9 +3,11 @@ package pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -16,7 +18,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type OrderState int32 @@ -75,6 +77,7 @@ var OrderState_name = map[int32]string{ 13: "PAYMENT_FINALIZED", 14: "PROCESSING_ERROR", } + var OrderState_value = map[string]int32{ "PENDING": 0, "AWAITING_PAYMENT": 1, @@ -96,17 +99,18 @@ var OrderState_value = map[string]int32{ func (x OrderState) String() string { return proto.EnumName(OrderState_name, int32(x)) } + func (OrderState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_orders_c6051e92f6cf6ced, []int{0} + return fileDescriptor_e0f5d4cf0fc9e41b, []int{0} } func init() { proto.RegisterEnum("OrderState", OrderState_name, OrderState_value) } -func init() { proto.RegisterFile("orders.proto", fileDescriptor_orders_c6051e92f6cf6ced) } +func init() { proto.RegisterFile("orders.proto", fileDescriptor_e0f5d4cf0fc9e41b) } -var fileDescriptor_orders_c6051e92f6cf6ced = []byte{ +var fileDescriptor_e0f5d4cf0fc9e41b = []byte{ // 243 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0x4d, 0x4e, 0xc3, 0x30, 0x10, 0x85, 0xa1, 0x94, 0xfe, 0x4c, 0x53, 0x18, 0xdc, 0x22, 0x38, 0x03, 0x0b, 0x36, 0x9c, 0xc0, diff --git a/pb/posts.pb.go b/pb/posts.pb.go index 3f05963eba..0deb6cfcbb 100644 --- a/pb/posts.pb.go +++ b/pb/posts.pb.go @@ -3,10 +3,12 @@ package pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import timestamp "github.com/golang/protobuf/ptypes/timestamp" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -17,7 +19,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Post_PostType int32 @@ -32,6 +34,7 @@ var Post_PostType_name = map[int32]string{ 1: "COMMENT", 2: "REPOST", } + var Post_PostType_value = map[string]int32{ "POST": 0, "COMMENT": 1, @@ -41,8 +44,9 @@ var Post_PostType_value = map[string]int32{ func (x Post_PostType) String() string { return proto.EnumName(Post_PostType_name, int32(x)) } + func (Post_PostType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_posts_590fe5621382a1af, []int{0, 0} + return fileDescriptor_b14bd1586479c33d, []int{0, 0} } type Post struct { @@ -65,16 +69,17 @@ func (m *Post) Reset() { *m = Post{} } func (m *Post) String() string { return proto.CompactTextString(m) } func (*Post) ProtoMessage() {} func (*Post) Descriptor() ([]byte, []int) { - return fileDescriptor_posts_590fe5621382a1af, []int{0} + return fileDescriptor_b14bd1586479c33d, []int{0} } + func (m *Post) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Post.Unmarshal(m, b) } func (m *Post) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Post.Marshal(b, m, deterministic) } -func (dst *Post) XXX_Merge(src proto.Message) { - xxx_messageInfo_Post.Merge(dst, src) +func (m *Post) XXX_Merge(src proto.Message) { + xxx_messageInfo_Post.Merge(m, src) } func (m *Post) XXX_Size() int { return xxx_messageInfo_Post.Size(m) @@ -171,16 +176,17 @@ func (m *Post_Image) Reset() { *m = Post_Image{} } func (m *Post_Image) String() string { return proto.CompactTextString(m) } func (*Post_Image) ProtoMessage() {} func (*Post_Image) Descriptor() ([]byte, []int) { - return fileDescriptor_posts_590fe5621382a1af, []int{0, 0} + return fileDescriptor_b14bd1586479c33d, []int{0, 0} } + func (m *Post_Image) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Post_Image.Unmarshal(m, b) } func (m *Post_Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Post_Image.Marshal(b, m, deterministic) } -func (dst *Post_Image) XXX_Merge(src proto.Message) { - xxx_messageInfo_Post_Image.Merge(dst, src) +func (m *Post_Image) XXX_Merge(src proto.Message) { + xxx_messageInfo_Post_Image.Merge(m, src) } func (m *Post_Image) XXX_Size() int { return xxx_messageInfo_Post_Image.Size(m) @@ -246,16 +252,17 @@ func (m *SignedPost) Reset() { *m = SignedPost{} } func (m *SignedPost) String() string { return proto.CompactTextString(m) } func (*SignedPost) ProtoMessage() {} func (*SignedPost) Descriptor() ([]byte, []int) { - return fileDescriptor_posts_590fe5621382a1af, []int{1} + return fileDescriptor_b14bd1586479c33d, []int{1} } + func (m *SignedPost) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignedPost.Unmarshal(m, b) } func (m *SignedPost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SignedPost.Marshal(b, m, deterministic) } -func (dst *SignedPost) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedPost.Merge(dst, src) +func (m *SignedPost) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedPost.Merge(m, src) } func (m *SignedPost) XXX_Size() int { return xxx_messageInfo_SignedPost.Size(m) @@ -288,15 +295,15 @@ func (m *SignedPost) GetSignature() []byte { } func init() { + proto.RegisterEnum("Post_PostType", Post_PostType_name, Post_PostType_value) proto.RegisterType((*Post)(nil), "Post") proto.RegisterType((*Post_Image)(nil), "Post.Image") proto.RegisterType((*SignedPost)(nil), "SignedPost") - proto.RegisterEnum("Post_PostType", Post_PostType_name, Post_PostType_value) } -func init() { proto.RegisterFile("posts.proto", fileDescriptor_posts_590fe5621382a1af) } +func init() { proto.RegisterFile("posts.proto", fileDescriptor_b14bd1586479c33d) } -var fileDescriptor_posts_590fe5621382a1af = []byte{ +var fileDescriptor_b14bd1586479c33d = []byte{ // 429 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x92, 0x4f, 0x8b, 0xdb, 0x30, 0x10, 0xc5, 0xeb, 0xc4, 0xf6, 0xda, 0xe3, 0xb2, 0x5d, 0x44, 0x29, 0x6a, 0x28, 0xac, 0x49, 0x2f, diff --git a/pb/profile.pb.go b/pb/profile.pb.go index 8b0232f678..d5043d3b37 100644 --- a/pb/profile.pb.go +++ b/pb/profile.pb.go @@ -3,10 +3,12 @@ package pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import timestamp "github.com/golang/protobuf/ptypes/timestamp" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -17,7 +19,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Profile struct { PeerID string `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"` @@ -47,16 +49,17 @@ func (m *Profile) Reset() { *m = Profile{} } func (m *Profile) String() string { return proto.CompactTextString(m) } func (*Profile) ProtoMessage() {} func (*Profile) Descriptor() ([]byte, []int) { - return fileDescriptor_profile_919697bf31a273ce, []int{0} + return fileDescriptor_744bf7a47b381504, []int{0} } + func (m *Profile) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Profile.Unmarshal(m, b) } func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Profile.Marshal(b, m, deterministic) } -func (dst *Profile) XXX_Merge(src proto.Message) { - xxx_messageInfo_Profile.Merge(dst, src) +func (m *Profile) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile.Merge(m, src) } func (m *Profile) XXX_Size() int { return xxx_messageInfo_Profile.Size(m) @@ -207,16 +210,17 @@ func (m *Profile_Contact) Reset() { *m = Profile_Contact{} } func (m *Profile_Contact) String() string { return proto.CompactTextString(m) } func (*Profile_Contact) ProtoMessage() {} func (*Profile_Contact) Descriptor() ([]byte, []int) { - return fileDescriptor_profile_919697bf31a273ce, []int{0, 0} + return fileDescriptor_744bf7a47b381504, []int{0, 0} } + func (m *Profile_Contact) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Profile_Contact.Unmarshal(m, b) } func (m *Profile_Contact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Profile_Contact.Marshal(b, m, deterministic) } -func (dst *Profile_Contact) XXX_Merge(src proto.Message) { - xxx_messageInfo_Profile_Contact.Merge(dst, src) +func (m *Profile_Contact) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile_Contact.Merge(m, src) } func (m *Profile_Contact) XXX_Size() int { return xxx_messageInfo_Profile_Contact.Size(m) @@ -268,16 +272,17 @@ func (m *Profile_SocialAccount) Reset() { *m = Profile_SocialAccount{} } func (m *Profile_SocialAccount) String() string { return proto.CompactTextString(m) } func (*Profile_SocialAccount) ProtoMessage() {} func (*Profile_SocialAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_profile_919697bf31a273ce, []int{0, 1} + return fileDescriptor_744bf7a47b381504, []int{0, 1} } + func (m *Profile_SocialAccount) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Profile_SocialAccount.Unmarshal(m, b) } func (m *Profile_SocialAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Profile_SocialAccount.Marshal(b, m, deterministic) } -func (dst *Profile_SocialAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_Profile_SocialAccount.Merge(dst, src) +func (m *Profile_SocialAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile_SocialAccount.Merge(m, src) } func (m *Profile_SocialAccount) XXX_Size() int { return xxx_messageInfo_Profile_SocialAccount.Size(m) @@ -324,16 +329,17 @@ func (m *Profile_Image) Reset() { *m = Profile_Image{} } func (m *Profile_Image) String() string { return proto.CompactTextString(m) } func (*Profile_Image) ProtoMessage() {} func (*Profile_Image) Descriptor() ([]byte, []int) { - return fileDescriptor_profile_919697bf31a273ce, []int{0, 2} + return fileDescriptor_744bf7a47b381504, []int{0, 2} } + func (m *Profile_Image) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Profile_Image.Unmarshal(m, b) } func (m *Profile_Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Profile_Image.Marshal(b, m, deterministic) } -func (dst *Profile_Image) XXX_Merge(src proto.Message) { - xxx_messageInfo_Profile_Image.Merge(dst, src) +func (m *Profile_Image) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile_Image.Merge(m, src) } func (m *Profile_Image) XXX_Size() int { return xxx_messageInfo_Profile_Image.Size(m) @@ -394,16 +400,17 @@ func (m *Profile_Colors) Reset() { *m = Profile_Colors{} } func (m *Profile_Colors) String() string { return proto.CompactTextString(m) } func (*Profile_Colors) ProtoMessage() {} func (*Profile_Colors) Descriptor() ([]byte, []int) { - return fileDescriptor_profile_919697bf31a273ce, []int{0, 3} + return fileDescriptor_744bf7a47b381504, []int{0, 3} } + func (m *Profile_Colors) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Profile_Colors.Unmarshal(m, b) } func (m *Profile_Colors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Profile_Colors.Marshal(b, m, deterministic) } -func (dst *Profile_Colors) XXX_Merge(src proto.Message) { - xxx_messageInfo_Profile_Colors.Merge(dst, src) +func (m *Profile_Colors) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile_Colors.Merge(m, src) } func (m *Profile_Colors) XXX_Size() int { return xxx_messageInfo_Profile_Colors.Size(m) @@ -465,16 +472,17 @@ func (m *Profile_Stats) Reset() { *m = Profile_Stats{} } func (m *Profile_Stats) String() string { return proto.CompactTextString(m) } func (*Profile_Stats) ProtoMessage() {} func (*Profile_Stats) Descriptor() ([]byte, []int) { - return fileDescriptor_profile_919697bf31a273ce, []int{0, 4} + return fileDescriptor_744bf7a47b381504, []int{0, 4} } + func (m *Profile_Stats) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Profile_Stats.Unmarshal(m, b) } func (m *Profile_Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Profile_Stats.Marshal(b, m, deterministic) } -func (dst *Profile_Stats) XXX_Merge(src proto.Message) { - xxx_messageInfo_Profile_Stats.Merge(dst, src) +func (m *Profile_Stats) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile_Stats.Merge(m, src) } func (m *Profile_Stats) XXX_Size() int { return xxx_messageInfo_Profile_Stats.Size(m) @@ -536,9 +544,9 @@ func init() { proto.RegisterType((*Profile_Stats)(nil), "Profile.Stats") } -func init() { proto.RegisterFile("profile.proto", fileDescriptor_profile_919697bf31a273ce) } +func init() { proto.RegisterFile("profile.proto", fileDescriptor_744bf7a47b381504) } -var fileDescriptor_profile_919697bf31a273ce = []byte{ +var fileDescriptor_744bf7a47b381504 = []byte{ // 705 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x94, 0xdf, 0x6e, 0xdb, 0x36, 0x14, 0xc6, 0xe1, 0xff, 0x31, 0x6d, 0x27, 0x19, 0x31, 0x04, 0x84, 0x30, 0x6c, 0x46, 0x10, 0x6c, diff --git a/pb/protos/message.proto b/pb/protos/message.proto index 22bd33adbb..340736e98e 100644 --- a/pb/protos/message.proto +++ b/pb/protos/message.proto @@ -33,6 +33,7 @@ message Message { STORE = 18; BLOCK = 19; VENDOR_FINALIZED_PAYMENT = 20; + ORDER_PAYMENT = 21; ERROR = 500; } } @@ -82,4 +83,11 @@ message Error { uint32 code = 1; string errorMessage = 2; string orderID = 3; -} \ No newline at end of file +} + +message OrderPaymentTxn { + string coin = 1; + string orderID = 2; + string transactionID = 3; + bool withInput = 4; +} diff --git a/util/utils.go b/util/utils.go new file mode 100644 index 0000000000..be5e2b041d --- /dev/null +++ b/util/utils.go @@ -0,0 +1,15 @@ +package util + +import ( + "strings" +) + +// NormalizeAddress is used to strip the 0x prefix +func NormalizeAddress(addr string) string { + return strings.Replace(addr, "0x", "", 1) +} + +// AreAddressesEqual - check if addresses are equal after normalizing them +func AreAddressesEqual(addr1, addr2 string) bool { + return NormalizeAddress(addr1) == NormalizeAddress(addr2) +} diff --git a/vendor/github.com/OpenBazaar/bitcoind-wallet/wallet.go b/vendor/github.com/OpenBazaar/bitcoind-wallet/wallet.go index eaaecd4a0b..ba1862f8fb 100644 --- a/vendor/github.com/OpenBazaar/bitcoind-wallet/wallet.go +++ b/vendor/github.com/OpenBazaar/bitcoind-wallet/wallet.go @@ -427,11 +427,37 @@ func (w *BitcoindWallet) GetTransaction(txid chainhash.Hash) (wallet.Txn, error) if err != nil { return t, err } + t.Txid = resp.TxID t.Value = int64(resp.Amount * 100000000) t.Height = int32(resp.BlockIndex) t.Timestamp = time.Unix(resp.TimeReceived, 0) t.WatchOnly = false + + raw, err := w.rpcClient.GetRawTransaction(&txid) + if err != nil { + return t, err + } + + outs := []wallet.TransactionOutput{} + for i, out := range raw.MsgTx().TxOut { + var addr btc.Address + _, addrs, _, err := txscript.ExtractPkScriptAddrs(out.PkScript, w.params) + if err != nil { + log.Warningf("error extracting address from txn pkscript: %v\n", err) + } + if len(addrs) != 0 { + addr = addrs[0] + } + tout := wallet.TransactionOutput{ + Address: addr, + Value: out.Value, + Index: uint32(i), + } + outs = append(outs, tout) + } + t.Outputs = outs + return t, nil } diff --git a/vendor/github.com/OpenBazaar/go-ethwallet/wallet/wallet.go b/vendor/github.com/OpenBazaar/go-ethwallet/wallet/wallet.go index aee34e745f..77cb252eac 100644 --- a/vendor/github.com/OpenBazaar/go-ethwallet/wallet/wallet.go +++ b/vendor/github.com/OpenBazaar/go-ethwallet/wallet/wallet.go @@ -390,6 +390,13 @@ func (wallet *EthereumWallet) GetTransaction(txid chainhash.Hash) (wi.Txn, error Timestamp: time.Now(), WatchOnly: false, Bytes: tx.Data(), + Outputs: []wi.TransactionOutput{ + { + Address: wallet.address, + Value: tx.Value().Int64(), + Index: 1, + }, + }, }, nil } @@ -472,7 +479,7 @@ func (wallet *EthereumWallet) Spend(amount int64, addr btcutil.Address, feeLevel // but valid txn like some contract condition causing revert if rcpt.Status > 0 { // all good to update order state - go wallet.callListeners(wallet.createTxnCallback(hash.Hex(), referenceID, amount, time.Now())) + go wallet.AssociateTransactionWithOrder(wallet.createTxnCallback(hash.Hex(), referenceID, amount, time.Now())) } else { // there was some error processing this txn nonce, err := wallet.client.GetTxnNonce(hash.Hex()) @@ -519,7 +526,7 @@ func (wallet *EthereumWallet) createTxnCallback(txID, orderID string, value int6 } } -func (wallet *EthereumWallet) callListeners(txnCB wi.TransactionCallback) { +func (wallet *EthereumWallet) AssociateTransactionWithOrder(txnCB wi.TransactionCallback) { for _, l := range wallet.listeners { go l(txnCB) } @@ -546,7 +553,7 @@ func (wallet *EthereumWallet) CheckTxnRcpt(hash *common.Hash, data []byte) (*com return nil, err } wallet.db.Txns().Delete(chash) - go wallet.callListeners(wallet.createTxnCallback(hash.Hex(), pTxn.OrderID, pTxn.Amount, time.Now())) + go wallet.AssociateTransactionWithOrder(wallet.createTxnCallback(hash.Hex(), pTxn.OrderID, pTxn.Amount, time.Now())) } } diff --git a/vendor/github.com/OpenBazaar/multiwallet/.golangci.yml b/vendor/github.com/OpenBazaar/multiwallet/.golangci.yml new file mode 100644 index 0000000000..e386637b73 --- /dev/null +++ b/vendor/github.com/OpenBazaar/multiwallet/.golangci.yml @@ -0,0 +1,52 @@ +run: + skip-dirs: + - vendor + +issues: + max-per-linter: 99999 + max-same: 99999 + exclude: + - composite literal uses unkeyed fields + +linters-settings: + errcheck: + check-type-assertions: false + check-blank: false + unparam: + algo: cha + check-exported: false + nakedret: + max-func-lines: 0 + misspell: + locale: US + dupl: + threshold: 600 + gocyclo: + min-complexity: 180 + lll: + line-length: 750 + +linters: + enable: + - unconvert + - gofmt + - ineffassign + - staticcheck + - structcheck + - unused + - varcheck + - deadcode + - gosimple + - gocyclo + - lll + - goconst + - govet + - megacheck + disable: + - dupl + - nakedret + - unparam + - goimports + - errcheck + - golint + - prealloc diff --git a/vendor/github.com/OpenBazaar/multiwallet/.travis.yml b/vendor/github.com/OpenBazaar/multiwallet/.travis.yml index 37e4f20d25..cf81ad5677 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/.travis.yml +++ b/vendor/github.com/OpenBazaar/multiwallet/.travis.yml @@ -1,16 +1,20 @@ language: go go: - - 1.11 + - "1.11" sudo: required services: - docker env: - "PATH=/home/travis/gopath/bin:$PATH" before_install: + - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - go get github.com/tcnksm/ghr - go get github.com/axw/gocov/gocov - go get github.com/mattn/goveralls + - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.15.0 +install: + - dep ensure script: - - diff -u <(echo -n) <(gofmt -d -s $(find . -type f -name '*.go' -not -path "./cmd/*" -not -path "./cli/*" -not -path "./api/*")) + - $GOPATH/bin/golangci-lint run --deadline 10m --new - cd $TRAVIS_BUILD_DIR && chmod a+x test_compile.sh && ./test_compile.sh - - goveralls -coverprofile=coverage.out -service travis-ci \ No newline at end of file + - goveralls -coverprofile=coverage.out -service travis-ci diff --git a/vendor/github.com/OpenBazaar/multiwallet/Gopkg.lock b/vendor/github.com/OpenBazaar/multiwallet/Gopkg.lock index c0f4338b2e..4d2683b2f5 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/Gopkg.lock +++ b/vendor/github.com/OpenBazaar/multiwallet/Gopkg.lock @@ -26,11 +26,11 @@ [[projects]] branch = "master" - digest = "1:0efd5e1f5ad2283a539357586532519154e3b9894ad611a896069c8c46e86874" + digest = "1:cdb20ba34409b4eb78ff013e71eafce40e49b42485dafcfb675b64c5cb3cdaca" name = "github.com/OpenBazaar/wallet-interface" packages = ["."] pruneopts = "UT" - revision = "90321224966c0c88e02e99f1f9d3cef18a77f399" + revision = "aa8e214acd9b86f0c7a190d2eaf269070f5b5f3c" [[projects]] digest = "1:0f98f59e9a2f4070d66f0c9c39561f68fcd1dc837b22a852d28d0003aebd1b1e" @@ -159,6 +159,47 @@ revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" version = "v1.1.1" +[[projects]] + digest = "1:1e9a0ec4f7e852123fefad9aadd7647eed1e9fd3716118e99a4b3dc463705c82" + name = "github.com/dchest/siphash" + packages = ["."] + pruneopts = "UT" + revision = "34f201214d993633bb24f418ba11736ab8b55aa7" + version = "v1.2.1" + +[[projects]] + digest = "1:700f82416846a964010b86fddeada0e1ceb1c96fa65acc4f234811a7d3e4fded" + name = "github.com/gcash/bchd" + packages = [ + "bchec", + "chaincfg", + "chaincfg/chainhash", + "txscript", + "wire", + ] + pruneopts = "UT" + revision = "34d8b67e58c8487e08cc2b8130398ec4f4bc6df5" + version = "v0.14.6" + +[[projects]] + branch = "master" + digest = "1:b1053b781e9090dab5d3e916eb04c8d85b63a7f6911007c2cd1dd82fb22f7f6a" + name = "github.com/gcash/bchlog" + packages = ["."] + pruneopts = "UT" + revision = "b4f036f92fa66c88eec458f4531ff14ff87704d6" + +[[projects]] + branch = "master" + digest = "1:2538b5efd7d3d7ac9efdfef955f5bcda82cbec4d6f8aef4d388f1c70e6318fc5" + name = "github.com/gcash/bchutil" + packages = [ + ".", + "base58", + ] + pruneopts = "UT" + revision = "800e62fe9aff291db8909a5dbf35c23cff8d1a62" + [[projects]] branch = "master" digest = "1:a54f931f516df9f3b2401e3cfa47482be79397d20fcbe838b7da6c63d5b8e615" @@ -406,6 +447,9 @@ "github.com/cpacia/BitcoinCash-Wallet", "github.com/cpacia/BitcoinCash-Wallet/exchangerates", "github.com/cpacia/bchutil", + "github.com/gcash/bchd/chaincfg/chainhash", + "github.com/gcash/bchd/txscript", + "github.com/gcash/bchd/wire", "github.com/golang/protobuf/proto", "github.com/golang/protobuf/ptypes/timestamp", "github.com/gorilla/websocket", diff --git a/vendor/github.com/OpenBazaar/multiwallet/Gopkg.toml b/vendor/github.com/OpenBazaar/multiwallet/Gopkg.toml index b212f04636..5f64b6d8fa 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/Gopkg.toml +++ b/vendor/github.com/OpenBazaar/multiwallet/Gopkg.toml @@ -25,10 +25,6 @@ # unused-packages = true -[[constraint]] - branch = "master" - name = "github.com/OpenBazaar/go-ethwallet" - [[constraint]] branch = "master" name = "github.com/OpenBazaar/golang-socketio" diff --git a/vendor/github.com/OpenBazaar/multiwallet/bitcoin/sign.go b/vendor/github.com/OpenBazaar/multiwallet/bitcoin/sign.go index 16f2ae9e06..361714b07a 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/bitcoin/sign.go +++ b/vendor/github.com/OpenBazaar/multiwallet/bitcoin/sign.go @@ -6,9 +6,10 @@ import ( "encoding/hex" "errors" "fmt" - "github.com/btcsuite/btcd/chaincfg" "time" + "github.com/btcsuite/btcd/chaincfg" + "github.com/OpenBazaar/spvwallet" wi "github.com/OpenBazaar/wallet-interface" "github.com/btcsuite/btcd/blockchain" @@ -358,10 +359,13 @@ func (w *BitcoinWallet) sweepAddress(ins []wi.TransactionInput, address *btc.Add // Sign tx privKey, err := key.ECPrivKey() if err != nil { - return nil, err + return nil, fmt.Errorf("retrieving private key: %s", err.Error()) } pk := privKey.PubKey().SerializeCompressed() addressPub, err := btc.NewAddressPubKey(pk, w.params) + if err != nil { + return nil, fmt.Errorf("generating address pub key: %s", err.Error()) + } getKey := txscript.KeyClosure(func(addr btc.Address) (*btcec.PrivateKey, bool, error) { if addressPub.EncodeAddress() == addr.EncodeAddress() { diff --git a/vendor/github.com/OpenBazaar/multiwallet/bitcoin/wallet.go b/vendor/github.com/OpenBazaar/multiwallet/bitcoin/wallet.go index 26a6701d5e..2e022f8bc1 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/bitcoin/wallet.go +++ b/vendor/github.com/OpenBazaar/multiwallet/bitcoin/wallet.go @@ -25,6 +25,7 @@ import ( btc "github.com/btcsuite/btcutil" hd "github.com/btcsuite/btcutil/hdkeychain" "github.com/btcsuite/btcwallet/wallet/txrules" + logging "github.com/op/go-logging" bip39 "github.com/tyler-smith/go-bip39" "golang.org/x/net/proxy" ) @@ -41,6 +42,7 @@ type BitcoinWallet struct { mPubKey *hd.ExtendedKey exchangeRates wi.ExchangeRates + log *logging.Logger } func NewBitcoinWallet(cfg config.CoinConfig, mnemonic string, params *chaincfg.Params, proxy proxy.Dialer, cache cache.Cacher, disableExchangeRates bool) (*BitcoinWallet, error) { @@ -75,7 +77,18 @@ func NewBitcoinWallet(cfg config.CoinConfig, mnemonic string, params *chaincfg.P fp := spvwallet.NewFeeProvider(cfg.MaxFee, cfg.HighFee, cfg.MediumFee, cfg.LowFee, cfg.FeeAPI, proxy) - return &BitcoinWallet{cfg.DB, km, params, c, wm, fp, mPrivKey, mPubKey, er}, nil + return &BitcoinWallet{ + db: cfg.DB, + km: km, + params: params, + client: c, + ws: wm, + fp: fp, + mPrivKey: mPrivKey, + mPubKey: mPubKey, + exchangeRates: er, + log: logging.MustGetLogger("bitcoin-wallet"), + }, nil } func keyToAddress(key *hd.ExtendedKey, params *chaincfg.Params) (btc.Address, error) { @@ -213,6 +226,34 @@ func (w *BitcoinWallet) Transactions() ([]wi.Txn, error) { func (w *BitcoinWallet) GetTransaction(txid chainhash.Hash) (wi.Txn, error) { txn, err := w.db.Txns().Get(txid) + if err == nil { + tx := wire.NewMsgTx(1) + rbuf := bytes.NewReader(txn.Bytes) + err := tx.BtcDecode(rbuf, wire.ProtocolVersion, wire.WitnessEncoding) + if err != nil { + return txn, err + } + outs := []wi.TransactionOutput{} + for i, out := range tx.TxOut { + var addr btc.Address + _, addrs, _, err := txscript.ExtractPkScriptAddrs(out.PkScript, w.params) + if err != nil { + w.log.Errorf("error extracting address from txn pkscript: %v\n", err) + } + if len(addrs) == 0 { + addr = nil + } else { + addr = addrs[0] + } + tout := wi.TransactionOutput{ + Address: addr, + Value: out.Value, + Index: uint32(i), + } + outs = append(outs, tout) + } + txn.Outputs = outs + } return txn, err } diff --git a/vendor/github.com/OpenBazaar/multiwallet/bitcoincash/sign.go b/vendor/github.com/OpenBazaar/multiwallet/bitcoincash/sign.go index f24e72f03b..dd3dc5bd19 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/bitcoincash/sign.go +++ b/vendor/github.com/OpenBazaar/multiwallet/bitcoincash/sign.go @@ -5,9 +5,10 @@ import ( "encoding/hex" "errors" "fmt" - "github.com/btcsuite/btcd/chaincfg" "time" + "github.com/btcsuite/btcd/chaincfg" + "github.com/OpenBazaar/spvwallet" wi "github.com/OpenBazaar/wallet-interface" "github.com/btcsuite/btcd/blockchain" @@ -287,7 +288,7 @@ func (w *BitcoinCashWallet) bumpFee(txid chainhash.Hash) (*chainhash.Hash, error LinkedAddress: addr, OutpointIndex: u.Op.Index, OutpointHash: h, - Value: int64(u.Value), + Value: u.Value, } transactionID, err := w.sweepAddress([]wi.TransactionInput{in}, nil, key, nil, wi.FEE_BUMP) if err != nil { @@ -364,10 +365,13 @@ func (w *BitcoinCashWallet) sweepAddress(ins []wi.TransactionInput, address *btc // Sign tx privKey, err := key.ECPrivKey() if err != nil { - return nil, err + return nil, fmt.Errorf("retrieving private key: %s", err.Error()) } pk := privKey.PubKey().SerializeCompressed() addressPub, err := btc.NewAddressPubKey(pk, w.params) + if err != nil { + return nil, fmt.Errorf("generating address pub key: %s", err.Error()) + } getKey := txscript.KeyClosure(func(addr btc.Address) (*btcec.PrivateKey, bool, error) { if addressPub.EncodeAddress() == addr.EncodeAddress() { diff --git a/vendor/github.com/OpenBazaar/multiwallet/bitcoincash/wallet.go b/vendor/github.com/OpenBazaar/multiwallet/bitcoincash/wallet.go index 3988874bc8..650bd83136 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/bitcoincash/wallet.go +++ b/vendor/github.com/OpenBazaar/multiwallet/bitcoincash/wallet.go @@ -5,15 +5,9 @@ import ( "encoding/hex" "fmt" "io" + "log" "time" - "github.com/OpenBazaar/multiwallet/cache" - "github.com/OpenBazaar/multiwallet/client" - "github.com/OpenBazaar/multiwallet/config" - "github.com/OpenBazaar/multiwallet/keys" - "github.com/OpenBazaar/multiwallet/model" - "github.com/OpenBazaar/multiwallet/service" - "github.com/OpenBazaar/multiwallet/util" wi "github.com/OpenBazaar/wallet-interface" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" @@ -26,6 +20,14 @@ import ( "github.com/cpacia/bchutil" "github.com/tyler-smith/go-bip39" "golang.org/x/net/proxy" + + "github.com/OpenBazaar/multiwallet/cache" + "github.com/OpenBazaar/multiwallet/client" + "github.com/OpenBazaar/multiwallet/config" + "github.com/OpenBazaar/multiwallet/keys" + "github.com/OpenBazaar/multiwallet/model" + "github.com/OpenBazaar/multiwallet/service" + "github.com/OpenBazaar/multiwallet/util" ) type BitcoinCashWallet struct { @@ -209,6 +211,28 @@ func (w *BitcoinCashWallet) Transactions() ([]wi.Txn, error) { func (w *BitcoinCashWallet) GetTransaction(txid chainhash.Hash) (wi.Txn, error) { txn, err := w.db.Txns().Get(txid) + if err == nil { + tx := wire.NewMsgTx(1) + rbuf := bytes.NewReader(txn.Bytes) + err := tx.BtcDecode(rbuf, wire.ProtocolVersion, wire.WitnessEncoding) + if err != nil { + return txn, err + } + outs := []wi.TransactionOutput{} + for i, out := range tx.TxOut { + addr, err := bchutil.ExtractPkScriptAddrs(out.PkScript, w.params) + if err != nil { + log.Printf("error extracting address from txn pkscript: %v\n", err) + } + tout := wi.TransactionOutput{ + Address: addr, + Value: out.Value, + Index: uint32(i), + } + outs = append(outs, tout) + } + txn.Outputs = outs + } return txn, err } diff --git a/vendor/github.com/OpenBazaar/multiwallet/litecoin/sign.go b/vendor/github.com/OpenBazaar/multiwallet/litecoin/sign.go index cb7242a2c4..bf4af00617 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/litecoin/sign.go +++ b/vendor/github.com/OpenBazaar/multiwallet/litecoin/sign.go @@ -6,9 +6,10 @@ import ( "encoding/hex" "errors" "fmt" - "github.com/btcsuite/btcd/chaincfg" "time" + "github.com/btcsuite/btcd/chaincfg" + "github.com/OpenBazaar/spvwallet" wi "github.com/OpenBazaar/wallet-interface" "github.com/btcsuite/btcd/blockchain" @@ -363,10 +364,13 @@ func (w *LitecoinWallet) sweepAddress(ins []wi.TransactionInput, address *btc.Ad // Sign tx privKey, err := key.ECPrivKey() if err != nil { - return nil, err + return nil, fmt.Errorf("retrieving private key: %s", err.Error()) } pk := privKey.PubKey().SerializeCompressed() addressPub, err := btc.NewAddressPubKey(pk, w.params) + if err != nil { + return nil, fmt.Errorf("generating address pub key: %s", err.Error()) + } getKey := txscript.KeyClosure(func(addr btc.Address) (*btcec.PrivateKey, bool, error) { if addressPub.EncodeAddress() == addr.EncodeAddress() { diff --git a/vendor/github.com/OpenBazaar/multiwallet/litecoin/wallet.go b/vendor/github.com/OpenBazaar/multiwallet/litecoin/wallet.go index fd3ca16cf2..74c8fdd75f 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/litecoin/wallet.go +++ b/vendor/github.com/OpenBazaar/multiwallet/litecoin/wallet.go @@ -7,8 +7,6 @@ import ( "io" "time" - "github.com/ltcsuite/ltcutil" - "github.com/OpenBazaar/multiwallet/cache" "github.com/OpenBazaar/multiwallet/client" "github.com/OpenBazaar/multiwallet/config" @@ -23,7 +21,9 @@ import ( "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" hd "github.com/btcsuite/btcutil/hdkeychain" + "github.com/ltcsuite/ltcutil" "github.com/ltcsuite/ltcwallet/wallet/txrules" + logging "github.com/op/go-logging" "github.com/tyler-smith/go-bip39" "golang.org/x/net/proxy" ) @@ -40,6 +40,7 @@ type LitecoinWallet struct { mPubKey *hd.ExtendedKey exchangeRates wi.ExchangeRates + log *logging.Logger } func NewLitecoinWallet(cfg config.CoinConfig, mnemonic string, params *chaincfg.Params, proxy proxy.Dialer, cache cache.Cacher, disableExchangeRates bool) (*LitecoinWallet, error) { @@ -74,7 +75,18 @@ func NewLitecoinWallet(cfg config.CoinConfig, mnemonic string, params *chaincfg. fp := util.NewFeeDefaultProvider(cfg.MaxFee, cfg.HighFee, cfg.MediumFee, cfg.LowFee) - return &LitecoinWallet{cfg.DB, km, params, c, wm, fp, mPrivKey, mPubKey, er}, nil + return &LitecoinWallet{ + db: cfg.DB, + km: km, + params: params, + client: c, + ws: wm, + fp: fp, + mPrivKey: mPrivKey, + mPubKey: mPubKey, + exchangeRates: er, + log: logging.MustGetLogger("litecoin-wallet"), + }, nil } func litecoinAddress(key *hd.ExtendedKey, params *chaincfg.Params) (btcutil.Address, error) { @@ -160,10 +172,7 @@ func (w *LitecoinWallet) AddressToScript(addr btcutil.Address) ([]byte, error) { func (w *LitecoinWallet) HasKey(addr btcutil.Address) bool { _, err := w.km.GetKeyForScript(addr.ScriptAddress()) - if err != nil { - return false - } - return true + return err == nil } func (w *LitecoinWallet) Balance() (confirmed, unconfirmed int64) { @@ -208,6 +217,28 @@ func (w *LitecoinWallet) Transactions() ([]wi.Txn, error) { func (w *LitecoinWallet) GetTransaction(txid chainhash.Hash) (wi.Txn, error) { txn, err := w.db.Txns().Get(txid) + if err == nil { + tx := wire.NewMsgTx(1) + rbuf := bytes.NewReader(txn.Bytes) + err := tx.BtcDecode(rbuf, wire.ProtocolVersion, wire.WitnessEncoding) + if err != nil { + return txn, err + } + outs := []wi.TransactionOutput{} + for i, out := range tx.TxOut { + addr, err := laddr.ExtractPkScriptAddrs(out.PkScript, w.params) + if err != nil { + w.log.Errorf("error extracting address from txn pkscript: %v\n", err) + } + tout := wi.TransactionOutput{ + Address: addr, + Value: out.Value, + Index: uint32(i), + } + outs = append(outs, tout) + } + txn.Outputs = outs + } return txn, err } diff --git a/vendor/github.com/OpenBazaar/multiwallet/multiwallet.go b/vendor/github.com/OpenBazaar/multiwallet/multiwallet.go index 5bb297479f..e9e10cedc9 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/multiwallet.go +++ b/vendor/github.com/OpenBazaar/multiwallet/multiwallet.go @@ -112,7 +112,7 @@ func (w *MultiWallet) Close() { func (w *MultiWallet) WalletForCurrencyCode(currencyCode string) (wallet.Wallet, error) { for _, wl := range *w { - if strings.ToUpper(wl.CurrencyCode()) == strings.ToUpper(currencyCode) || strings.ToUpper(wl.CurrencyCode()) == "T"+strings.ToUpper(currencyCode) { + if strings.EqualFold(wl.CurrencyCode(), currencyCode) || strings.EqualFold(wl.CurrencyCode(), "T"+currencyCode) { return wl, nil } } diff --git a/vendor/github.com/OpenBazaar/multiwallet/service/wallet_service.go b/vendor/github.com/OpenBazaar/multiwallet/service/wallet_service.go index 9d3b53caef..c26d12e755 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/service/wallet_service.go +++ b/vendor/github.com/OpenBazaar/multiwallet/service/wallet_service.go @@ -104,7 +104,7 @@ func (ws *WalletService) ChainTip() (uint32, chainhash.Hash) { if err != nil { Log.Errorf("producing BestBlock hash: %s", err.Error()) } - return uint32(ws.chainHeight), *ch + return ws.chainHeight, *ch } func (ws *WalletService) AddTransactionListener(callback func(callback wallet.TransactionCallback)) { @@ -160,7 +160,7 @@ func (ws *WalletService) ProcessIncomingTransaction(tx model.Transaction) { utxo := model.Utxo{ Txid: tx.Txid, ScriptPubKey: out.ScriptPubKey.Hex, - Satoshis: int64(math.Round(out.Value * float64(util.SatoshisPerCoin(ws.coinType)))), + Satoshis: int64(math.Round(out.Value * util.SatoshisPerCoin(ws.coinType))), Vout: out.N, Address: addr, Confirmations: 0, diff --git a/vendor/github.com/OpenBazaar/multiwallet/zcash/wallet.go b/vendor/github.com/OpenBazaar/multiwallet/zcash/wallet.go index ca840deb5c..32b738e053 100644 --- a/vendor/github.com/OpenBazaar/multiwallet/zcash/wallet.go +++ b/vendor/github.com/OpenBazaar/multiwallet/zcash/wallet.go @@ -1,6 +1,7 @@ package zcash import ( + "bytes" "encoding/hex" "fmt" "io" @@ -21,6 +22,7 @@ import ( "github.com/btcsuite/btcutil" hd "github.com/btcsuite/btcutil/hdkeychain" "github.com/btcsuite/btcwallet/wallet/txrules" + logging "github.com/op/go-logging" "github.com/tyler-smith/go-bip39" "golang.org/x/net/proxy" ) @@ -37,6 +39,7 @@ type ZCashWallet struct { mPubKey *hd.ExtendedKey exchangeRates wi.ExchangeRates + log *logging.Logger } func NewZCashWallet(cfg config.CoinConfig, mnemonic string, params *chaincfg.Params, proxy proxy.Dialer, cache cache.Cacher, disableExchangeRates bool) (*ZCashWallet, error) { @@ -72,7 +75,18 @@ func NewZCashWallet(cfg config.CoinConfig, mnemonic string, params *chaincfg.Par fp := util.NewFeeDefaultProvider(cfg.MaxFee, cfg.HighFee, cfg.MediumFee, cfg.LowFee) - return &ZCashWallet{cfg.DB, km, params, c, wm, fp, mPrivKey, mPubKey, er}, nil + return &ZCashWallet{ + db: cfg.DB, + km: km, + params: params, + client: c, + ws: wm, + fp: fp, + mPrivKey: mPrivKey, + mPubKey: mPubKey, + exchangeRates: er, + log: logging.MustGetLogger("zcash-wallet"), + }, nil } func zcashCashAddress(key *hd.ExtendedKey, params *chaincfg.Params) (btcutil.Address, error) { @@ -172,6 +186,14 @@ func (w *ZCashWallet) HasKey(addr btcutil.Address) bool { func (w *ZCashWallet) Balance() (confirmed, unconfirmed int64) { utxos, _ := w.db.Utxos().GetAll() txns, _ := w.db.Txns().GetAll(false) + // Zcash transactions have additional data embedded in them + // that is not expected by the BtcDecode deserialize function. + // We strip off the extra data here so the derserialize function + // does not error. This will have no affect on the balance calculation + // as the metadata is not used in the calculation. + for i, tx := range txns { + txns[i].Bytes = tx.Bytes[4 : len(tx.Bytes)-15] + } return util.CalcBalance(utxos, txns) } @@ -211,6 +233,28 @@ func (w *ZCashWallet) Transactions() ([]wi.Txn, error) { func (w *ZCashWallet) GetTransaction(txid chainhash.Hash) (wi.Txn, error) { txn, err := w.db.Txns().Get(txid) + if err == nil { + tx := wire.NewMsgTx(1) + rbuf := bytes.NewReader(txn.Bytes) + err := tx.BtcDecode(rbuf, wire.ProtocolVersion, wire.WitnessEncoding) + if err != nil { + return txn, err + } + outs := []wi.TransactionOutput{} + for i, out := range tx.TxOut { + addr, err := zaddr.ExtractPkScriptAddrs(out.PkScript, w.params) + if err != nil { + w.log.Errorf("error extracting address from txn pkscript: %v\n", err) + } + tout := wi.TransactionOutput{ + Address: addr, + Value: out.Value, + Index: uint32(i), + } + outs = append(outs, tout) + } + txn.Outputs = outs + } return txn, err } diff --git a/vendor/github.com/OpenBazaar/spvwallet/blockchain.go b/vendor/github.com/OpenBazaar/spvwallet/blockchain.go index 2ea11866a0..9f15da68cc 100644 --- a/vendor/github.com/OpenBazaar/spvwallet/blockchain.go +++ b/vendor/github.com/OpenBazaar/spvwallet/blockchain.go @@ -296,7 +296,7 @@ func (b *Blockchain) GetBlockLocator() blockchain.BlockLocator { return blockchain.BlockLocator(ret) } -// Returns last header before reorg point +// GetCommonAncestor returns last header before reorg point func (b *Blockchain) GetCommonAncestor(bestHeader, prevBestHeader StoredHeader) (*StoredHeader, error) { var err error rollback := func(parent StoredHeader, n int) (StoredHeader, error) { diff --git a/vendor/github.com/OpenBazaar/spvwallet/sortsignsend.go b/vendor/github.com/OpenBazaar/spvwallet/sortsignsend.go index e5cc550d0b..e24e0105b4 100644 --- a/vendor/github.com/OpenBazaar/spvwallet/sortsignsend.go +++ b/vendor/github.com/OpenBazaar/spvwallet/sortsignsend.go @@ -698,7 +698,6 @@ func (w *SPVWallet) buildTx(amount int64, addr btc.Address, feeLevel wallet.FeeL func (w *SPVWallet) buildSpendAllTx(addr btc.Address, feeLevel wallet.FeeLevel) (*wire.MsgTx, error) { tx := wire.NewMsgTx(1) - coinMap := w.gatherCoins() inVals := make(map[wire.OutPoint]int64) totalIn := int64(0) diff --git a/vendor/github.com/OpenBazaar/spvwallet/txstore.go b/vendor/github.com/OpenBazaar/spvwallet/txstore.go index a0044c450f..857ea1d174 100644 --- a/vendor/github.com/OpenBazaar/spvwallet/txstore.go +++ b/vendor/github.com/OpenBazaar/spvwallet/txstore.go @@ -94,7 +94,7 @@ func (ts *TxStore) GimmeFilter() (*bloom.Filter, error) { return f, nil } -// GetDoubleSpends takes a transaction and compares it with +// CheckDoubleSpends takes a transaction and compares it with // all transactions in the db. It returns a slice of all txids in the db // which are double spent by the received tx. func (ts *TxStore) CheckDoubleSpends(argTx *wire.MsgTx) ([]*chainhash.Hash, error) { diff --git a/vendor/github.com/OpenBazaar/spvwallet/wallet.go b/vendor/github.com/OpenBazaar/spvwallet/wallet.go index 215a957b8c..ee6f53856b 100644 --- a/vendor/github.com/OpenBazaar/spvwallet/wallet.go +++ b/vendor/github.com/OpenBazaar/spvwallet/wallet.go @@ -1,23 +1,26 @@ package spvwallet import ( + "bytes" "errors" "io" "sync" "time" - "github.com/OpenBazaar/spvwallet/exchangerates" "github.com/OpenBazaar/wallet-interface" "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/peer" "github.com/btcsuite/btcd/txscript" + "github.com/btcsuite/btcd/wire" btc "github.com/btcsuite/btcutil" hd "github.com/btcsuite/btcutil/hdkeychain" "github.com/btcsuite/btcwallet/wallet/txrules" "github.com/op/go-logging" b39 "github.com/tyler-smith/go-bip39" + + "github.com/OpenBazaar/spvwallet/exchangerates" ) type SPVWallet struct { @@ -358,6 +361,34 @@ func (w *SPVWallet) Transactions() ([]wallet.Txn, error) { func (w *SPVWallet) GetTransaction(txid chainhash.Hash) (wallet.Txn, error) { txn, err := w.txstore.Txns().Get(txid) + if err == nil { + tx := wire.NewMsgTx(1) + rbuf := bytes.NewReader(txn.Bytes) + err := tx.BtcDecode(rbuf, wire.ProtocolVersion, wire.WitnessEncoding) + if err != nil { + return txn, err + } + outs := []wallet.TransactionOutput{} + for i, out := range tx.TxOut { + var addr btc.Address + _, addrs, _, err := txscript.ExtractPkScriptAddrs(out.PkScript, w.params) + if err != nil { + log.Warningf("error extracting address from txn pkscript: %v\n", err) + } + if len(addrs) == 0 { + addr = nil + } else { + addr = addrs[0] + } + tout := wallet.TransactionOutput{ + Address: addr, + Value: out.Value, + Index: uint32(i), + } + outs = append(outs, tout) + } + txn.Outputs = outs + } return txn, err } @@ -447,6 +478,8 @@ func (w *SPVWallet) ExchangeRates() wallet.ExchangeRates { return w.exchangeRates } + +// AssociateTransactionWithOrder used for ORDER_PAYMENT message func (w *SPVWallet) AssociateTransactionWithOrder(cb wallet.TransactionCallback) { for _, l := range w.txstore.listeners { go l(cb) diff --git a/vendor/github.com/OpenBazaar/wallet-interface/datastore.go b/vendor/github.com/OpenBazaar/wallet-interface/datastore.go index 2086d944d3..1853506d44 100644 --- a/vendor/github.com/OpenBazaar/wallet-interface/datastore.go +++ b/vendor/github.com/OpenBazaar/wallet-interface/datastore.go @@ -2,10 +2,11 @@ package wallet import ( "bytes" + "time" + "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" - "time" ) type Coin interface { @@ -22,11 +23,11 @@ const ( BitcoinCash = 145 Ethereum = 60 - TestnetBitcoin = 1000000 - TestnetLitecoin = 1000001 - TestnetZcash = 1000133 - TestnetBitcoinCash = 1000145 - TestnetEthereum = 1000060 + TestnetBitcoin = 1000000 + TestnetLitecoin = 1000001 + TestnetZcash = 1000133 + TestnetBitcoinCash = 1000145 + TestnetEthereum = 1000060 ) func (c *CoinType) String() string { @@ -288,6 +289,11 @@ type Txn struct { // Raw transaction bytes Bytes []byte + + FromAddress string + ToAddress string + + Outputs []TransactionOutput } type StatusCode string diff --git a/vendor/github.com/OpenBazaar/wallet-interface/wallet.go b/vendor/github.com/OpenBazaar/wallet-interface/wallet.go index 8fac251a96..e411b1e942 100644 --- a/vendor/github.com/OpenBazaar/wallet-interface/wallet.go +++ b/vendor/github.com/OpenBazaar/wallet-interface/wallet.go @@ -55,11 +55,11 @@ type Wallet interface { // associated. If the interface is supported, AssociateTransactionToOrder must be called as // early as is reasonable to ensure proper reporting of payment. type WalletMustManuallyAssociateTransactionToOrder interface { - // AssociateOrderToTransaction must be called for wallets which implement it to support + // AssociateTransactionWithOrder must be called for wallets which implement it to support // wallet implementations which are not able to generate unique Addresses on a per-Order // basis. It should be called as soon as the wallet transaction and referenceID are both // known by the openbazaar-go node (which should be reported from the buyer to the vendor). - AssociateTransactionToOrder(txid chainhash.Hash, referenceID string) error + AssociateTransactionWithOrder(cb TransactionCallback) } type walletMustManager interface { diff --git a/vendor/github.com/OpenBazaar/zcashd-wallet/wallet.go b/vendor/github.com/OpenBazaar/zcashd-wallet/wallet.go index 9eac728391..1dcad8926c 100644 --- a/vendor/github.com/OpenBazaar/zcashd-wallet/wallet.go +++ b/vendor/github.com/OpenBazaar/zcashd-wallet/wallet.go @@ -476,6 +476,32 @@ func (w *ZcashdWallet) GetTransaction(txid chainhash.Hash) (wallet.Txn, error) { t.Height = int32(resp.BlockIndex) t.Timestamp = time.Unix(resp.TimeReceived, 0) t.WatchOnly = false + + tx := wire.NewMsgTx(1) + rbuf := bytes.NewReader([]byte(resp.Hex)) + err = tx.BtcDecode(rbuf, wire.ProtocolVersion, wire.WitnessEncoding) + if err != nil { + return t, err + } + outs := []wallet.TransactionOutput{} + for i, out := range tx.TxOut { + var addr btc.Address + _, addrs, _, err := txscript.ExtractPkScriptAddrs(out.PkScript, w.params) + if err != nil { + log.Warningf("error extracting address from txn pkscript: %v\n", err) + } + if len(addrs) != 0 { + addr = addrs[0] + } + tout := wallet.TransactionOutput{ + Address: addr, + Value: out.Value, + Index: uint32(i), + } + outs = append(outs, tout) + } + t.Outputs = outs + return t, nil } diff --git a/vendor/github.com/cpacia/BitcoinCash-Wallet/wallet.go b/vendor/github.com/cpacia/BitcoinCash-Wallet/wallet.go index e20705063d..c3cc353ef9 100644 --- a/vendor/github.com/cpacia/BitcoinCash-Wallet/wallet.go +++ b/vendor/github.com/cpacia/BitcoinCash-Wallet/wallet.go @@ -1,6 +1,7 @@ package bitcoincash import ( + "bytes" "errors" "io" "sync" @@ -11,6 +12,8 @@ import ( "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/peer" + "github.com/btcsuite/btcd/txscript" + "github.com/btcsuite/btcd/wire" btc "github.com/btcsuite/btcutil" hd "github.com/btcsuite/btcutil/hdkeychain" "github.com/btcsuite/btcwallet/wallet/txrules" @@ -411,6 +414,34 @@ func (w *SPVWallet) Transactions() ([]wallet.Txn, error) { func (w *SPVWallet) GetTransaction(txid chainhash.Hash) (wallet.Txn, error) { txn, err := w.txstore.Txns().Get(txid) + if err == nil { + tx := wire.NewMsgTx(1) + rbuf := bytes.NewReader(txn.Bytes) + err := tx.BtcDecode(rbuf, wire.ProtocolVersion, wire.WitnessEncoding) + if err != nil { + return txn, err + } + outs := []wallet.TransactionOutput{} + for i, out := range tx.TxOut { + var addr btc.Address + _, addrs, _, err := txscript.ExtractPkScriptAddrs(out.PkScript, w.params) + if err != nil { + log.Warningf("error extracting address from txn pkscript: %v\n", err) + } + if len(addrs) == 0 { + addr = nil + } else { + addr = addrs[0] + } + tout := wallet.TransactionOutput{ + Address: addr, + Value: out.Value, + Index: uint32(i), + } + outs = append(outs, tout) + } + txn.Outputs = outs + } return txn, err } diff --git a/vendor/github.com/golang/protobuf/proto/deprecated.go b/vendor/github.com/golang/protobuf/proto/deprecated.go index 69de0ea0ef..35b882c09a 100644 --- a/vendor/github.com/golang/protobuf/proto/deprecated.go +++ b/vendor/github.com/golang/protobuf/proto/deprecated.go @@ -31,8 +31,33 @@ package proto +import "errors" + // Deprecated: do not use. type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 } // Deprecated: do not use. func GetStats() Stats { return Stats{} } + +// Deprecated: do not use. +func MarshalMessageSet(interface{}) ([]byte, error) { + return nil, errors.New("proto: not implemented") +} + +// Deprecated: do not use. +func UnmarshalMessageSet([]byte, interface{}) error { + return errors.New("proto: not implemented") +} + +// Deprecated: do not use. +func MarshalMessageSetJSON(interface{}) ([]byte, error) { + return nil, errors.New("proto: not implemented") +} + +// Deprecated: do not use. +func UnmarshalMessageSetJSON([]byte, interface{}) error { + return errors.New("proto: not implemented") +} + +// Deprecated: do not use. +func RegisterMessageSetType(Message, int32, string) {} diff --git a/vendor/github.com/golang/protobuf/proto/equal.go b/vendor/github.com/golang/protobuf/proto/equal.go index d4db5a1c14..f9b6e41b3c 100644 --- a/vendor/github.com/golang/protobuf/proto/equal.go +++ b/vendor/github.com/golang/protobuf/proto/equal.go @@ -246,7 +246,8 @@ func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool { return false } - m1, m2 := e1.value, e2.value + m1 := extensionAsLegacyType(e1.value) + m2 := extensionAsLegacyType(e2.value) if m1 == nil && m2 == nil { // Both have only encoded form. diff --git a/vendor/github.com/golang/protobuf/proto/extensions.go b/vendor/github.com/golang/protobuf/proto/extensions.go index dacdd22d2a..fa88add30a 100644 --- a/vendor/github.com/golang/protobuf/proto/extensions.go +++ b/vendor/github.com/golang/protobuf/proto/extensions.go @@ -185,9 +185,25 @@ type Extension struct { // extension will have only enc set. When such an extension is // accessed using GetExtension (or GetExtensions) desc and value // will be set. - desc *ExtensionDesc + desc *ExtensionDesc + + // value is a concrete value for the extension field. Let the type of + // desc.ExtensionType be the "API type" and the type of Extension.value + // be the "storage type". The API type and storage type are the same except: + // * For scalars (except []byte), the API type uses *T, + // while the storage type uses T. + // * For repeated fields, the API type uses []T, while the storage type + // uses *[]T. + // + // The reason for the divergence is so that the storage type more naturally + // matches what is expected of when retrieving the values through the + // protobuf reflection APIs. + // + // The value may only be populated if desc is also populated. value interface{} - enc []byte + + // enc is the raw bytes for the extension field. + enc []byte } // SetRawExtension is for testing only. @@ -334,7 +350,7 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) { // descriptors with the same field number. return nil, errors.New("proto: descriptor conflict") } - return e.value, nil + return extensionAsLegacyType(e.value), nil } if extension.ExtensionType == nil { @@ -349,11 +365,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) { // Remember the decoded version and drop the encoded version. // That way it is safe to mutate what we return. - e.value = v + e.value = extensionAsStorageType(v) e.desc = extension e.enc = nil emap[extension.Field] = e - return e.value, nil + return extensionAsLegacyType(e.value), nil } // defaultExtensionValue returns the default value for extension. @@ -500,7 +516,7 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error } extmap := epb.extensionsWrite() - extmap[extension.Field] = Extension{desc: extension, value: value} + extmap[extension.Field] = Extension{desc: extension, value: extensionAsStorageType(value)} return nil } @@ -541,3 +557,51 @@ func RegisterExtension(desc *ExtensionDesc) { func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc { return extensionMaps[reflect.TypeOf(pb).Elem()] } + +// extensionAsLegacyType converts an value in the storage type as the API type. +// See Extension.value. +func extensionAsLegacyType(v interface{}) interface{} { + switch rv := reflect.ValueOf(v); rv.Kind() { + case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: + // Represent primitive types as a pointer to the value. + rv2 := reflect.New(rv.Type()) + rv2.Elem().Set(rv) + v = rv2.Interface() + case reflect.Ptr: + // Represent slice types as the value itself. + switch rv.Type().Elem().Kind() { + case reflect.Slice: + if rv.IsNil() { + v = reflect.Zero(rv.Type().Elem()).Interface() + } else { + v = rv.Elem().Interface() + } + } + } + return v +} + +// extensionAsStorageType converts an value in the API type as the storage type. +// See Extension.value. +func extensionAsStorageType(v interface{}) interface{} { + switch rv := reflect.ValueOf(v); rv.Kind() { + case reflect.Ptr: + // Represent slice types as the value itself. + switch rv.Type().Elem().Kind() { + case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: + if rv.IsNil() { + v = reflect.Zero(rv.Type().Elem()).Interface() + } else { + v = rv.Elem().Interface() + } + } + case reflect.Slice: + // Represent slice types as a pointer to the value. + if rv.Type().Elem().Kind() != reflect.Uint8 { + rv2 := reflect.New(rv.Type()) + rv2.Elem().Set(rv) + v = rv2.Interface() + } + } + return v +} diff --git a/vendor/github.com/golang/protobuf/proto/lib.go b/vendor/github.com/golang/protobuf/proto/lib.go index c076dbdb91..fdd328bb7f 100644 --- a/vendor/github.com/golang/protobuf/proto/lib.go +++ b/vendor/github.com/golang/protobuf/proto/lib.go @@ -940,13 +940,19 @@ func isProto3Zero(v reflect.Value) bool { return false } -// ProtoPackageIsVersion2 is referenced from generated protocol buffer files -// to assert that that code is compatible with this version of the proto package. -const ProtoPackageIsVersion2 = true - -// ProtoPackageIsVersion1 is referenced from generated protocol buffer files -// to assert that that code is compatible with this version of the proto package. -const ProtoPackageIsVersion1 = true +const ( + // ProtoPackageIsVersion3 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + ProtoPackageIsVersion3 = true + + // ProtoPackageIsVersion2 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + ProtoPackageIsVersion2 = true + + // ProtoPackageIsVersion1 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + ProtoPackageIsVersion1 = true +) // InternalMessageInfo is a type used internally by generated .pb.go files. // This type is not intended to be used by non-generated code. diff --git a/vendor/github.com/golang/protobuf/proto/message_set.go b/vendor/github.com/golang/protobuf/proto/message_set.go index 3b6ca41d5e..f48a756761 100644 --- a/vendor/github.com/golang/protobuf/proto/message_set.go +++ b/vendor/github.com/golang/protobuf/proto/message_set.go @@ -36,13 +36,7 @@ package proto */ import ( - "bytes" - "encoding/json" "errors" - "fmt" - "reflect" - "sort" - "sync" ) // errNoMessageTypeID occurs when a protocol buffer does not have a message type ID. @@ -145,46 +139,9 @@ func skipVarint(buf []byte) []byte { return buf[i+1:] } -// MarshalMessageSet encodes the extension map represented by m in the message set wire format. -// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option. -func MarshalMessageSet(exts interface{}) ([]byte, error) { - return marshalMessageSet(exts, false) -} - -// marshaMessageSet implements above function, with the opt to turn on / off deterministic during Marshal. -func marshalMessageSet(exts interface{}, deterministic bool) ([]byte, error) { - switch exts := exts.(type) { - case *XXX_InternalExtensions: - var u marshalInfo - siz := u.sizeMessageSet(exts) - b := make([]byte, 0, siz) - return u.appendMessageSet(b, exts, deterministic) - - case map[int32]Extension: - // This is an old-style extension map. - // Wrap it in a new-style XXX_InternalExtensions. - ie := XXX_InternalExtensions{ - p: &struct { - mu sync.Mutex - extensionMap map[int32]Extension - }{ - extensionMap: exts, - }, - } - - var u marshalInfo - siz := u.sizeMessageSet(&ie) - b := make([]byte, 0, siz) - return u.appendMessageSet(b, &ie, deterministic) - - default: - return nil, errors.New("proto: not an extension map") - } -} - -// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format. +// unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format. // It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option. -func UnmarshalMessageSet(buf []byte, exts interface{}) error { +func unmarshalMessageSet(buf []byte, exts interface{}) error { var m map[int32]Extension switch exts := exts.(type) { case *XXX_InternalExtensions: @@ -222,93 +179,3 @@ func UnmarshalMessageSet(buf []byte, exts interface{}) error { } return nil } - -// MarshalMessageSetJSON encodes the extension map represented by m in JSON format. -// It is called by generated MarshalJSON methods on protocol buffer messages with the message_set_wire_format option. -func MarshalMessageSetJSON(exts interface{}) ([]byte, error) { - var m map[int32]Extension - switch exts := exts.(type) { - case *XXX_InternalExtensions: - var mu sync.Locker - m, mu = exts.extensionsRead() - if m != nil { - // Keep the extensions map locked until we're done marshaling to prevent - // races between marshaling and unmarshaling the lazily-{en,de}coded - // values. - mu.Lock() - defer mu.Unlock() - } - case map[int32]Extension: - m = exts - default: - return nil, errors.New("proto: not an extension map") - } - var b bytes.Buffer - b.WriteByte('{') - - // Process the map in key order for deterministic output. - ids := make([]int32, 0, len(m)) - for id := range m { - ids = append(ids, id) - } - sort.Sort(int32Slice(ids)) // int32Slice defined in text.go - - for i, id := range ids { - ext := m[id] - msd, ok := messageSetMap[id] - if !ok { - // Unknown type; we can't render it, so skip it. - continue - } - - if i > 0 && b.Len() > 1 { - b.WriteByte(',') - } - - fmt.Fprintf(&b, `"[%s]":`, msd.name) - - x := ext.value - if x == nil { - x = reflect.New(msd.t.Elem()).Interface() - if err := Unmarshal(ext.enc, x.(Message)); err != nil { - return nil, err - } - } - d, err := json.Marshal(x) - if err != nil { - return nil, err - } - b.Write(d) - } - b.WriteByte('}') - return b.Bytes(), nil -} - -// UnmarshalMessageSetJSON decodes the extension map encoded in buf in JSON format. -// It is called by generated UnmarshalJSON methods on protocol buffer messages with the message_set_wire_format option. -func UnmarshalMessageSetJSON(buf []byte, exts interface{}) error { - // Common-case fast path. - if len(buf) == 0 || bytes.Equal(buf, []byte("{}")) { - return nil - } - - // This is fairly tricky, and it's not clear that it is needed. - return errors.New("TODO: UnmarshalMessageSetJSON not yet implemented") -} - -// A global registry of types that can be used in a MessageSet. - -var messageSetMap = make(map[int32]messageSetDesc) - -type messageSetDesc struct { - t reflect.Type // pointer to struct - name string -} - -// RegisterMessageSetType is called from the generated code. -func RegisterMessageSetType(m Message, fieldNum int32, name string) { - messageSetMap[fieldNum] = messageSetDesc{ - t: reflect.TypeOf(m), - name: name, - } -} diff --git a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go index b6cad90834..94fa9194a8 100644 --- a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go +++ b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go @@ -79,10 +79,13 @@ func toPointer(i *Message) pointer { // toAddrPointer converts an interface to a pointer that points to // the interface data. -func toAddrPointer(i *interface{}, isptr bool) pointer { +func toAddrPointer(i *interface{}, isptr, deref bool) pointer { v := reflect.ValueOf(*i) u := reflect.New(v.Type()) u.Elem().Set(v) + if deref { + u = u.Elem() + } return pointer{v: u} } diff --git a/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go b/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go index d55a335d94..dbfffe071b 100644 --- a/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go +++ b/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go @@ -85,16 +85,21 @@ func toPointer(i *Message) pointer { // toAddrPointer converts an interface to a pointer that points to // the interface data. -func toAddrPointer(i *interface{}, isptr bool) pointer { +func toAddrPointer(i *interface{}, isptr, deref bool) (p pointer) { // Super-tricky - read or get the address of data word of interface value. if isptr { // The interface is of pointer type, thus it is a direct interface. // The data word is the pointer data itself. We take its address. - return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)} + p = pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)} + } else { + // The interface is not of pointer type. The data word is the pointer + // to the data. + p = pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} } - // The interface is not of pointer type. The data word is the pointer - // to the data. - return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} + if deref { + p.p = *(*unsafe.Pointer)(p.p) + } + return p } // valToPointer converts v to a pointer. v must be of pointer type. diff --git a/vendor/github.com/golang/protobuf/proto/properties.go b/vendor/github.com/golang/protobuf/proto/properties.go index dce098e6e1..a4b8c0cd3a 100644 --- a/vendor/github.com/golang/protobuf/proto/properties.go +++ b/vendor/github.com/golang/protobuf/proto/properties.go @@ -38,7 +38,6 @@ package proto import ( "fmt" "log" - "os" "reflect" "sort" "strconv" @@ -194,7 +193,7 @@ func (p *Properties) Parse(s string) { // "bytes,49,opt,name=foo,def=hello!" fields := strings.Split(s, ",") // breaks def=, but handled below. if len(fields) < 2 { - fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s) + log.Printf("proto: tag has too few fields: %q", s) return } @@ -214,7 +213,7 @@ func (p *Properties) Parse(s string) { p.WireType = WireBytes // no numeric converter for non-numeric types default: - fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s) + log.Printf("proto: tag has unknown wire type: %q", s) return } @@ -343,6 +342,15 @@ func GetProperties(t reflect.Type) *StructProperties { return sprop } +type ( + oneofFuncsIface interface { + XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) + } + oneofWrappersIface interface { + XXX_OneofWrappers() []interface{} + } +) + // getPropertiesLocked requires that propertiesMu is held. func getPropertiesLocked(t reflect.Type) *StructProperties { if prop, ok := propertiesMap[t]; ok { @@ -382,13 +390,14 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { // Re-order prop.order. sort.Sort(prop) - type oneofMessage interface { - XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) + var oots []interface{} + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: + _, _, _, oots = m.XXX_OneofFuncs() + case oneofWrappersIface: + oots = m.XXX_OneofWrappers() } - if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok { - var oots []interface{} - _, _, _, oots = om.XXX_OneofFuncs() - + if len(oots) > 0 { // Interpret oneof metadata. prop.OneofTypes = make(map[string]*OneofProperties) for _, oot := range oots { diff --git a/vendor/github.com/golang/protobuf/proto/table_marshal.go b/vendor/github.com/golang/protobuf/proto/table_marshal.go index f3a2d16a42..5cb11fa955 100644 --- a/vendor/github.com/golang/protobuf/proto/table_marshal.go +++ b/vendor/github.com/golang/protobuf/proto/table_marshal.go @@ -87,6 +87,7 @@ type marshalElemInfo struct { sizer sizer marshaler marshaler isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only) + deref bool // dereference the pointer before operating on it; implies isptr } var ( @@ -320,8 +321,11 @@ func (u *marshalInfo) computeMarshalInfo() { // get oneof implementers var oneofImplementers []interface{} - if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok { + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: _, _, _, oneofImplementers = m.XXX_OneofFuncs() + case oneofWrappersIface: + oneofImplementers = m.XXX_OneofWrappers() } n := t.NumField() @@ -407,13 +411,22 @@ func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElemInfo { panic("tag is not an integer") } wt := wiretype(tags[0]) + if t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct { + t = t.Elem() + } sizer, marshaler := typeMarshaler(t, tags, false, false) + var deref bool + if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 { + t = reflect.PtrTo(t) + deref = true + } e = &marshalElemInfo{ wiretag: uint64(tag)<<3 | wt, tagsize: SizeVarint(uint64(tag) << 3), sizer: sizer, marshaler: marshaler, isptr: t.Kind() == reflect.Ptr, + deref: deref, } // update cache @@ -476,10 +489,6 @@ func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofI } } -type oneofMessage interface { - XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) -} - // wiretype returns the wire encoding of the type. func wiretype(encoding string) uint64 { switch encoding { @@ -2310,8 +2319,8 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) { for _, k := range m.MapKeys() { ki := k.Interface() vi := m.MapIndex(k).Interface() - kaddr := toAddrPointer(&ki, false) // pointer to key - vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value + kaddr := toAddrPointer(&ki, false, false) // pointer to key + vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1) n += siz + SizeVarint(uint64(siz)) + tagsize } @@ -2329,8 +2338,8 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) { for _, k := range keys { ki := k.Interface() vi := m.MapIndex(k).Interface() - kaddr := toAddrPointer(&ki, false) // pointer to key - vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value + kaddr := toAddrPointer(&ki, false, false) // pointer to key + vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value b = appendVarint(b, tag) siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1) b = appendVarint(b, uint64(siz)) @@ -2399,7 +2408,7 @@ func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int { // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, ei.tagsize) } mu.Unlock() @@ -2434,7 +2443,7 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err @@ -2465,7 +2474,7 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err @@ -2510,7 +2519,7 @@ func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int { ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, 1) // message, tag = 3 (size=1) } mu.Unlock() @@ -2553,7 +2562,7 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic) if !nerr.Merge(err) { return b, err @@ -2591,7 +2600,7 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic) b = append(b, 1<<3|WireEndGroup) if !nerr.Merge(err) { @@ -2621,7 +2630,7 @@ func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int { ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, ei.tagsize) } return n @@ -2656,7 +2665,7 @@ func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, determ ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err diff --git a/vendor/github.com/golang/protobuf/proto/table_unmarshal.go b/vendor/github.com/golang/protobuf/proto/table_unmarshal.go index fd4afec8d2..acee2fc529 100644 --- a/vendor/github.com/golang/protobuf/proto/table_unmarshal.go +++ b/vendor/github.com/golang/protobuf/proto/table_unmarshal.go @@ -136,7 +136,7 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error { u.computeUnmarshalInfo() } if u.isMessageSet { - return UnmarshalMessageSet(b, m.offset(u.extensions).toExtensions()) + return unmarshalMessageSet(b, m.offset(u.extensions).toExtensions()) } var reqMask uint64 // bitmask of required fields we've seen. var errLater error @@ -362,46 +362,48 @@ func (u *unmarshalInfo) computeUnmarshalInfo() { } // Find any types associated with oneof fields. - // TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it? - fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs") - if fn.IsValid() { - res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{} - for i := res.Len() - 1; i >= 0; i-- { - v := res.Index(i) // interface{} - tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X - typ := tptr.Elem() // Msg_X - - f := typ.Field(0) // oneof implementers have one field - baseUnmarshal := fieldUnmarshaler(&f) - tags := strings.Split(f.Tag.Get("protobuf"), ",") - fieldNum, err := strconv.Atoi(tags[1]) - if err != nil { - panic("protobuf tag field not an integer: " + tags[1]) - } - var name string - for _, tag := range tags { - if strings.HasPrefix(tag, "name=") { - name = strings.TrimPrefix(tag, "name=") - break - } + var oneofImplementers []interface{} + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: + _, _, _, oneofImplementers = m.XXX_OneofFuncs() + case oneofWrappersIface: + oneofImplementers = m.XXX_OneofWrappers() + } + for _, v := range oneofImplementers { + tptr := reflect.TypeOf(v) // *Msg_X + typ := tptr.Elem() // Msg_X + + f := typ.Field(0) // oneof implementers have one field + baseUnmarshal := fieldUnmarshaler(&f) + tags := strings.Split(f.Tag.Get("protobuf"), ",") + fieldNum, err := strconv.Atoi(tags[1]) + if err != nil { + panic("protobuf tag field not an integer: " + tags[1]) + } + var name string + for _, tag := range tags { + if strings.HasPrefix(tag, "name=") { + name = strings.TrimPrefix(tag, "name=") + break } + } - // Find the oneof field that this struct implements. - // Might take O(n^2) to process all of the oneofs, but who cares. - for _, of := range oneofFields { - if tptr.Implements(of.ityp) { - // We have found the corresponding interface for this struct. - // That lets us know where this struct should be stored - // when we encounter it during unmarshaling. - unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal) - u.setTag(fieldNum, of.field, unmarshal, 0, name) - } + // Find the oneof field that this struct implements. + // Might take O(n^2) to process all of the oneofs, but who cares. + for _, of := range oneofFields { + if tptr.Implements(of.ityp) { + // We have found the corresponding interface for this struct. + // That lets us know where this struct should be stored + // when we encounter it during unmarshaling. + unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal) + u.setTag(fieldNum, of.field, unmarshal, 0, name) } } + } // Get extension ranges, if any. - fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray") + fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray") if fn.IsValid() { if !u.extensions.IsValid() && !u.oldExtensions.IsValid() { panic("a message with extensions, but no extensions field in " + t.Name()) diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go index b1560d9d25..78ee523349 100644 --- a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go +++ b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go @@ -5,9 +5,8 @@ package any import ( fmt "fmt" - math "math" - proto "github.com/golang/protobuf/proto" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -19,7 +18,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. @@ -102,17 +101,18 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // } // type Any struct { - // A URL/resource name whose content describes the type of the - // serialized protocol buffer message. + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). // - // For URLs which use the scheme `http`, `https`, or no scheme, the - // following restrictions and interpretations apply: + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. - // * The last segment of the URL's path must represent the fully - // qualified name of the type (as in `path/google.protobuf.Duration`). - // The name should be in a canonical form (e.g., leading "." is - // not accepted). // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the @@ -121,6 +121,10 @@ type Any struct { // on changes to types. (Use versioned type names to manage // breaking changes.) // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.proto b/vendor/github.com/golang/protobuf/ptypes/any/any.proto index c748667623..4932942558 100644 --- a/vendor/github.com/golang/protobuf/ptypes/any/any.proto +++ b/vendor/github.com/golang/protobuf/ptypes/any/any.proto @@ -120,17 +120,18 @@ option objc_class_prefix = "GPB"; // } // message Any { - // A URL/resource name whose content describes the type of the - // serialized protocol buffer message. + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). // - // For URLs which use the scheme `http`, `https`, or no scheme, the - // following restrictions and interpretations apply: + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. - // * The last segment of the URL's path must represent the fully - // qualified name of the type (as in `path/google.protobuf.Duration`). - // The name should be in a canonical form (e.g., leading "." is - // not accepted). // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the @@ -139,6 +140,10 @@ message Any { // on changes to types. (Use versioned type names to manage // breaking changes.) // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // diff --git a/vendor/github.com/golang/protobuf/ptypes/duration.go b/vendor/github.com/golang/protobuf/ptypes/duration.go index 65cb0f8eb5..26d1ca2fb5 100644 --- a/vendor/github.com/golang/protobuf/ptypes/duration.go +++ b/vendor/github.com/golang/protobuf/ptypes/duration.go @@ -82,7 +82,7 @@ func Duration(p *durpb.Duration) (time.Duration, error) { return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p) } if p.Nanos != 0 { - d += time.Duration(p.Nanos) + d += time.Duration(p.Nanos) * time.Nanosecond if (d < 0) != (p.Nanos < 0) { return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p) } diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go index bf2ea9708a..0d681ee21a 100644 --- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go +++ b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go @@ -5,9 +5,8 @@ package duration import ( fmt "fmt" - math "math" - proto "github.com/golang/protobuf/proto" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -19,7 +18,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp.go b/vendor/github.com/golang/protobuf/ptypes/timestamp.go index 47f10dbc2c..8da0df01ac 100644 --- a/vendor/github.com/golang/protobuf/ptypes/timestamp.go +++ b/vendor/github.com/golang/protobuf/ptypes/timestamp.go @@ -111,11 +111,9 @@ func TimestampNow() *tspb.Timestamp { // TimestampProto converts the time.Time to a google.protobuf.Timestamp proto. // It returns an error if the resulting Timestamp is invalid. func TimestampProto(t time.Time) (*tspb.Timestamp, error) { - seconds := t.Unix() - nanos := int32(t.Sub(time.Unix(seconds, 0))) ts := &tspb.Timestamp{ - Seconds: seconds, - Nanos: nanos, + Seconds: t.Unix(), + Nanos: int32(t.Nanosecond()), } if err := validateTimestamp(ts); err != nil { return nil, err diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go index bda47d6b94..31cd846de9 100644 --- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go +++ b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go @@ -5,9 +5,8 @@ package timestamp import ( fmt "fmt" - math "math" - proto "github.com/golang/protobuf/proto" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -19,7 +18,7 @@ var _ = math.Inf // 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.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // A Timestamp represents a point in time independent of any time zone // or calendar, represented as seconds and fractions of seconds at @@ -84,7 +83,9 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required, though only UTC (as indicated by "Z") is presently supported. +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. @@ -95,8 +96,8 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) // with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one // can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( -// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) -// to obtain a formatter capable of generating timestamps in this format. +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- +// ) to obtain a formatter capable of generating timestamps in this format. // // type Timestamp struct { diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto index 06750ab1f1..eafb3fa03a 100644 --- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto +++ b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto @@ -103,7 +103,9 @@ option objc_class_prefix = "GPB"; // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required, though only UTC (as indicated by "Z") is presently supported. +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. @@ -114,8 +116,8 @@ option objc_class_prefix = "GPB"; // to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) // with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one // can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( -// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) -// to obtain a formatter capable of generating timestamps in this format. +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- +// ) to obtain a formatter capable of generating timestamps in this format. // // message Timestamp {