diff --git a/.travis.yml b/.travis.yml index 724a5e258d..dc57e48c61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,11 @@ env: - "PATH=/home/travis/gopath/bin:$PATH" before_install: - go get -u github.com/axw/gocov/gocov github.com/mattn/goveralls github.com/tcnksm/ghr - - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.15.0 + - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.23.3 install: - echo "No external dependencies required. Skipping travis default library dependency setup to use vendors..." script: - - $GOPATH/bin/golangci-lint run --deadline 10m --new-from-rev=24dc0f64 + - $GOPATH/bin/golangci-lint run --deadline 10m --new-from-rev= - cd $TRAVIS_BUILD_DIR && go test -i && ./test_compile.sh - goveralls -coverprofile=coverage.out -service travis-ci -repotoken $COVERALLS_TOKEN after_success: diff --git a/api/endpoints.go b/api/endpoints.go index 8484b5dd62..cf26268f06 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -115,6 +115,8 @@ func post(i *jsonAPIHandler, path string, w http.ResponseWriter, r *http.Request i.POSTBulkUpdateCurrency(w, r) case strings.HasPrefix(path, "/ob/resendordermessage"): i.POSTResendOrderMessage(w, r) + case strings.HasPrefix(path, "/ob/hashmessage"): + i.POSTHashMessage(w, r) default: ErrorResponse(w, http.StatusNotFound, "Not Found") } diff --git a/api/jsonapi.go b/api/jsonapi.go index 4e7be901b6..d73fa32b2e 100644 --- a/api/jsonapi.go +++ b/api/jsonapi.go @@ -1675,9 +1675,14 @@ func (i *jsonAPIHandler) POSTOrderCancel(w http.ResponseWriter, r *http.Request) ErrorResponse(w, http.StatusNotFound, "order not found") return } + v5order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + ErrorResponse(w, http.StatusNotFound, "order not found") + return + } // TODO: Remove once broken contracts are migrated - lookupCoin := contract.BuyerOrder.Payment.AmountCurrency.Code + lookupCoin := v5order.Payment.AmountCurrency.Code _, err = i.node.LookupCurrency(lookupCoin) if err != nil { log.Warningf("invalid BuyerOrder.Payment.Coin (%s) on order (%s)", lookupCoin, can.OrderID) @@ -2022,8 +2027,14 @@ func (i *jsonAPIHandler) POSTOrderComplete(w http.ResponseWriter, r *http.Reques return } + v5order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + ErrorResponse(w, http.StatusNotFound, "order not found") + return + } + // TODO: Remove once broken contracts are migrated - lookupCoin := contract.BuyerOrder.Payment.AmountCurrency.Code + lookupCoin := v5order.Payment.AmountCurrency.Code _, err = i.node.LookupCurrency(lookupCoin) if err != nil { log.Warningf("invalid BuyerOrder.Payment.Coin (%s) on order (%s)", lookupCoin, or.OrderID) @@ -2111,7 +2122,13 @@ func (i *jsonAPIHandler) POSTOpenDispute(w http.ResponseWriter, r *http.Request) } // TODO: Remove once broken contracts are migrated - lookupCoin := contract.BuyerOrder.Payment.AmountCurrency.Code + v5order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + ErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } + + lookupCoin := v5order.Payment.AmountCurrency.Code _, err = i.node.LookupCurrency(lookupCoin) if err != nil { log.Warningf("invalid BuyerOrder.Payment.Coin (%s) on order (%s)", lookupCoin, d.OrderID) @@ -2257,8 +2274,14 @@ func (i *jsonAPIHandler) POSTReleaseFunds(w http.ResponseWriter, r *http.Request } } + v5order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + ErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } + // TODO: Remove once broken contracts are migrated - lookupCoin := contract.BuyerOrder.Payment.AmountCurrency.Code + lookupCoin := v5order.Payment.AmountCurrency.Code _, err = i.node.LookupCurrency(lookupCoin) if err != nil { log.Warningf("invalid BuyerOrder.Payment.Coin (%s) on order (%s)", lookupCoin, rel.OrderID) @@ -3696,7 +3719,10 @@ func (i *jsonAPIHandler) POSTFetchRatings(w http.ResponseWriter, r *http.Request id := r.URL.Query().Get("asyncID") if id == "" { idBytes := make([]byte, 16) - rand.Read(idBytes) + _, err := rand.Read(idBytes) + if err != nil { + return + } id = base58.Encode(idBytes) } @@ -4403,3 +4429,26 @@ func (i *jsonAPIHandler) GETScanOfflineMessages(w http.ResponseWriter, r *http.R } SanitizedResponse(w, `{}`) } + +func (i *jsonAPIHandler) POSTHashMessage(w http.ResponseWriter, r *http.Request) { + type hashRequest struct { + Content string `json:"content"` + } + var ( + req hashRequest + err = json.NewDecoder(r.Body).Decode(&req) + ) + if err != nil { + ErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } + + messageHash, err := ipfs.EncodeMultihash([]byte(req.Content)) + if err != nil { + ErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } + + SanitizedResponse(w, fmt.Sprintf(`{"hash": "%s"}`, + messageHash.B58String())) +} diff --git a/core/core.go b/core/core.go index 6af7fe63af..a8a39ecbc6 100644 --- a/core/core.go +++ b/core/core.go @@ -31,7 +31,7 @@ import ( const ( // VERSION - current version - VERSION = "0.13.8" + VERSION = "0.14.0" // USERAGENT - user-agent header string USERAGENT = "/openbazaar-go:" + VERSION + "/" ) diff --git a/core/disputes.go b/core/disputes.go index 64a385b579..f4324229ec 100644 --- a/core/disputes.go +++ b/core/disputes.go @@ -502,12 +502,6 @@ func (n *OpenBazaarNode) CloseDispute(orderID string, buyerPercentage, vendorPer return ErrCloseFailureCaseExpired } - var outpoints = dispute.ResolutionPaymentOutpoints(payDivision) - if outpoints == nil { - log.Errorf("no outpoints to resolve in dispute for order %s", orderID) - return ErrCloseFailureNoOutpoints - } - if dispute.VendorContract == nil && vendorPercentage > 0 { return errors.New("vendor must provide his copy of the contract before you can release funds to the vendor") } @@ -521,6 +515,24 @@ func (n *OpenBazaarNode) CloseDispute(orderID string, buyerPercentage, vendorPer return err } + var outpoints = dispute.ResolutionPaymentOutpoints(payDivision) + if outpoints == nil { + log.Errorf("no outpoints to resolve in dispute for order %s", orderID) + return ErrCloseFailureNoOutpoints + } + for i, o := range outpoints { + if preferredContract.VendorListings[0].Metadata.Version < repo.ListingVersion { + if o.BigValue != "" { + n, ok := new(big.Int).SetString(o.BigValue, 10) + if !ok { + return errors.New("invalid amount") + } + outpoints[i].Value = n.Uint64() + outpoints[i].BigValue = "" + } + } + } + // TODO: Remove once broken contracts are migrated paymentCoin := preferredOrder.Payment.AmountCurrency.Code _, err = n.LookupCurrency(paymentCoin) @@ -563,9 +575,15 @@ func (n *OpenBazaarNode) CloseDispute(orderID string, buyerPercentage, vendorPer // Calculate total out value totalOut := big.NewInt(0) for _, o := range outpoints { - n, ok := new(big.Int).SetString(o.BigValue, 10) - if !ok { - return errors.New("invalid total out amount") + var n *big.Int + if o.Value > 0 { + n = big.NewInt(int64(o.Value)) + } else { + ok := false + n, ok = new(big.Int).SetString(o.BigValue, 10) + if !ok { + return errors.New("invalid amount") + } } totalOut = new(big.Int).Add(totalOut, n) } @@ -640,9 +658,15 @@ func (n *OpenBazaarNode) CloseDispute(orderID string, buyerPercentage, vendorPer if err != nil { return err } - n, ok := new(big.Int).SetString(o.BigValue, 10) - if !ok { - return errors.New("invalid amount") + var n *big.Int + if o.Value > 0 { + n = big.NewInt(int64(o.Value)) + } else { + ok := false + n, ok = new(big.Int).SetString(o.BigValue, 10) + if !ok { + return errors.New("invalid amount") + } } input := wallet.TransactionInput{ OutpointHash: decodedHash, @@ -738,25 +762,39 @@ func (n *OpenBazaarNode) CloseDispute(orderID string, buyerPercentage, vendorPer if out, ok := outMap["buyer"]; ok { payout.BuyerOutput = &pb.DisputeResolution_Payout_Output{ ScriptOrAddress: &pb.DisputeResolution_Payout_Output_Address{Address: buyerAddr.String()}, - BigAmount: out.Value.String(), + } + if preferredContract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + payout.BuyerOutput.BigAmount = out.Value.String() + } else { + payout.BuyerOutput.Amount = out.Value.Uint64() } } if out, ok := outMap["vendor"]; ok { payout.VendorOutput = &pb.DisputeResolution_Payout_Output{ ScriptOrAddress: &pb.DisputeResolution_Payout_Output_Address{Address: vendorAddr.String()}, - BigAmount: out.Value.String(), + } + if preferredContract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + payout.VendorOutput.BigAmount = out.Value.String() + } else { + payout.VendorOutput.Amount = out.Value.Uint64() } } if out, ok := outMap["moderator"]; ok { payout.ModeratorOutput = &pb.DisputeResolution_Payout_Output{ ScriptOrAddress: &pb.DisputeResolution_Payout_Output_Address{Address: modAddr.String()}, - BigAmount: out.Value.String(), + } + if preferredContract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + payout.ModeratorOutput.BigAmount = out.Value.String() + } else { + payout.ModeratorOutput.Amount = out.Value.Uint64() } } - payout.PayoutCurrency = &pb.CurrencyDefinition{ - Code: preferredOrder.Payment.AmountCurrency.Code, - Divisibility: preferredOrder.Payment.AmountCurrency.Divisibility, + if preferredContract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + payout.PayoutCurrency = &pb.CurrencyDefinition{ + Code: preferredOrder.Payment.AmountCurrency.Code, + Divisibility: preferredOrder.Payment.AmountCurrency.Divisibility, + } } d.Payout = payout @@ -1210,6 +1248,12 @@ func (n *OpenBazaarNode) ReleaseFunds(contract *pb.RicardianContract, records [] peerID := order.BuyerID.PeerID + // Build, sign, and broadcast transaction + txnID, err := wal.Multisign(inputs, outputs, mySigs, moderatorSigs, redeemScriptBytes, *big.NewInt(0), true) + if err != nil { + return err + } + // Update database if n.IpfsNode.Identity.Pretty() == order.BuyerID.PeerID { err = n.Datastore.Purchases().Put(orderID, *contract, pb.OrderState_DECIDED, true) @@ -1221,12 +1265,6 @@ func (n *OpenBazaarNode) ReleaseFunds(contract *pb.RicardianContract, records [] log.Errorf("ReleaseFunds error updating database: %s", err.Error()) } - // Build, sign, and broadcast transaction - txnID, err := wal.Multisign(inputs, outputs, mySigs, moderatorSigs, redeemScriptBytes, *big.NewInt(0), true) - if err != nil { - return err - } - err = n.SendOrderPayment(&SpendResponse{ Txid: util.NormalizeAddress(hexutil.Encode(txnID)), Currency: ¤cyDef, diff --git a/core/order.go b/core/order.go index 6c68a82f28..1dee49cc87 100644 --- a/core/order.go +++ b/core/order.go @@ -165,9 +165,13 @@ func (n *OpenBazaarNode) Purchase(data *repo.PurchaseData) (orderID string, paym payment.Method = pb.Order_Payment_ADDRESS_REQUEST contract.BuyerOrder.Payment = payment - payment.AmountCurrency = &pb.CurrencyDefinition{ - Code: defn.Code.String(), - Divisibility: uint32(defn.Divisibility), + if contract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + payment.AmountCurrency = &pb.CurrencyDefinition{ + Code: defn.Code.String(), + Divisibility: uint32(defn.Divisibility), + } + } else { + payment.Coin = defn.Code.String() } // Calculate payment amount @@ -180,7 +184,11 @@ func (n *OpenBazaarNode) Purchase(data *repo.PurchaseData) (orderID string, paym return "", "", retCurrency, false, ErrSpendAmountIsDust } - payment.BigAmount = total.String() + if contract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + payment.BigAmount = total.String() + } else { + payment.Amount = total.Uint64() + } contract, err = n.SignOrder(contract) if err != nil { @@ -209,14 +217,6 @@ func prepareModeratedOrderContract(data *repo.PurchaseData, n *OpenBazaarNode, c payment := new(pb.Order_Payment) payment.Method = pb.Order_Payment_MODERATED payment.Moderator = data.Moderator - defn, err := n.LookupCurrency(data.PaymentCoin) - if err != nil { - return nil, errors.New("invalid payment coin") - } - payment.AmountCurrency = &pb.CurrencyDefinition{ - Code: defn.Code.String(), - Divisibility: uint32(defn.Divisibility), - } profile, err := n.FetchProfile(data.Moderator, true) if err != nil { @@ -234,15 +234,32 @@ func prepareModeratedOrderContract(data *repo.PurchaseData, n *OpenBazaarNode, c return nil, errors.New("moderator does not accept our currency") } contract.BuyerOrder.Payment = payment - payment.AmountCurrency = &pb.CurrencyDefinition{ - Code: defn.Code.String(), - Divisibility: uint32(defn.Divisibility), + defn, err := n.LookupCurrency(data.PaymentCoin) + if err != nil { + return nil, errors.New("invalid payment coin") + } + if contract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + payment.AmountCurrency = &pb.CurrencyDefinition{ + Code: defn.Code.String(), + Divisibility: uint32(defn.Divisibility), + } + payment.AmountCurrency = &pb.CurrencyDefinition{ + Code: defn.Code.String(), + Divisibility: uint32(defn.Divisibility), + } + } else { + payment.Coin = defn.Code.String() } + total, err := n.CalculateOrderTotal(contract) if err != nil { return nil, err } - payment.BigAmount = total.String() + if contract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + payment.BigAmount = total.String() + } else { + payment.Amount = total.Uint64() + } contract.BuyerOrder.Payment = payment fpb := wal.GetFeePerByte(wallet.NORMAL) @@ -290,7 +307,11 @@ func prepareModeratedOrderContract(data *repo.PurchaseData, n *OpenBazaarNode, c payment.RedeemScript = hex.EncodeToString(redeemScript) payment.Chaincode = hex.EncodeToString(chaincode) fee := wal.GetFeePerByte(wallet.NORMAL) - contract.BuyerOrder.BigRefundFee = fee.String() + if contract.VendorListings[0].Metadata.Version >= repo.ListingVersion { + contract.BuyerOrder.BigRefundFee = fee.String() + } else { + contract.BuyerOrder.RefundFee = fee.Uint64() + } err = wal.AddWatchedAddresses(addr) if err != nil { @@ -341,7 +362,12 @@ func processOnlineDirectOrder(resp *pb.Message, n *OpenBazaarNode, wal wallet.Wa if err != nil { return "", "", *big.NewInt(0), false, err } - total, ok := new(big.Int).SetString(contract.BuyerOrder.Payment.BigAmount, 10) + + v5Order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + return "", "", *big.NewInt(0), false, err + } + total, ok := new(big.Int).SetString(v5Order.Payment.BigAmount, 10) if !ok { return "", "", *big.NewInt(0), false, errors.New("invalid payment amount") } @@ -351,8 +377,12 @@ func processOnlineDirectOrder(resp *pb.Message, n *OpenBazaarNode, wal wallet.Wa func processOfflineDirectOrder(n *OpenBazaarNode, wal wallet.Wallet, contract *pb.RicardianContract, payment *pb.Order_Payment) (string, string, big.Int, error) { // Vendor offline // Change payment code to direct + v5Order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + return "", "", *big.NewInt(0), err + } - total, ok := new(big.Int).SetString(contract.BuyerOrder.Payment.BigAmount, 10) + total, ok := new(big.Int).SetString(v5Order.Payment.BigAmount, 10) if !ok { return "", "", *big.NewInt(0), errors.New("invalid payment amount") } @@ -368,7 +398,7 @@ func processOfflineDirectOrder(n *OpenBazaarNode, wal wallet.Wallet, contract *p /* Generate a payment address using the first child key derived from the buyer's and vendors's masterPubKeys and a random chaincode. */ chaincode := make([]byte, 32) - _, err := rand.Read(chaincode) + _, err = rand.Read(chaincode) if err != nil { return "", "", *big.NewInt(0), err } @@ -434,6 +464,10 @@ func processOfflineDirectOrder(n *OpenBazaarNode, wal wallet.Wallet, contract *p } func processOnlineModeratedOrder(resp *pb.Message, n *OpenBazaarNode, contract *pb.RicardianContract) (string, string, big.Int, bool, error) { + v5Order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + return "", "", *big.NewInt(0), false, err + } // Vendor responded if resp.MessageType == pb.Message_ERROR { return "", "", *big.NewInt(0), false, extractErrorMessage(resp) @@ -442,7 +476,7 @@ func processOnlineModeratedOrder(resp *pb.Message, n *OpenBazaarNode, contract * return "", "", *big.NewInt(0), false, errors.New("vendor responded to the order with an incorrect message type") } rc := new(pb.RicardianContract) - err := proto.Unmarshal(resp.Payload.Value, rc) + err = proto.Unmarshal(resp.Payload.Value, rc) if err != nil { return "", "", *big.NewInt(0), false, errors.New("error parsing the vendor's response") } @@ -467,7 +501,7 @@ func processOnlineModeratedOrder(resp *pb.Message, n *OpenBazaarNode, contract * if err != nil { return "", "", *big.NewInt(0), false, err } - total, ok := new(big.Int).SetString(contract.BuyerOrder.Payment.BigAmount, 10) + total, ok := new(big.Int).SetString(v5Order.Payment.BigAmount, 10) if !ok { return "", "", *big.NewInt(0), false, errors.New("invalid payment amount") } @@ -475,6 +509,10 @@ func processOnlineModeratedOrder(resp *pb.Message, n *OpenBazaarNode, contract * } func processOfflineModeratedOrder(n *OpenBazaarNode, contract *pb.RicardianContract) (string, string, big.Int, error) { + v5Order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + return "", "", *big.NewInt(0), err + } // Vendor offline // Send using offline messaging log.Warningf("Vendor %s is offline, sending offline order message", contract.VendorListings[0].VendorID.PeerID) @@ -506,11 +544,11 @@ func processOfflineModeratedOrder(n *OpenBazaarNode, contract *pb.RicardianContr if err != nil { log.Error(err) } - total, ok := new(big.Int).SetString(contract.BuyerOrder.Payment.BigAmount, 10) + total, ok := new(big.Int).SetString(v5Order.Payment.BigAmount, 10) if !ok { return "", "", *big.NewInt(0), errors.New("invalid payment amount") } - return orderID, contract.BuyerOrder.Payment.Address, *total, err + return orderID, v5Order.Payment.Address, *total, err } func extractErrorMessage(m *pb.Message) error { @@ -708,7 +746,6 @@ func getListing(n *OpenBazaarNode, contract *pb.RicardianContract, item repo.Ite if err := sl.GetListing().GetVendorID().Valid(); err != nil { return nil, fmt.Errorf("invalid vendor info: %s", err.Error()) } - if err := sl.ValidateListing(n.TestNetworkEnabled() || n.RegressionNetworkEnabled()); err != nil { return nil, fmt.Errorf("validating listing (%s): %s", sl.GetSlug(), err.Error()) } @@ -820,11 +857,16 @@ func (n *OpenBazaarNode) EstimateOrderTotal(data *repo.PurchaseData) (*big.Int, // CancelOfflineOrder - cancel order func (n *OpenBazaarNode) CancelOfflineOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error { + v5Order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + return err + } + orderID, err := n.CalcOrderID(contract.BuyerOrder) if err != nil { return err } - wal, err := n.Multiwallet.WalletForCurrencyCode(contract.BuyerOrder.Payment.AmountCurrency.Code) + wal, err := n.Multiwallet.WalletForCurrencyCode(v5Order.Payment.AmountCurrency.Code) if err != nil { return err } @@ -854,7 +896,7 @@ func (n *OpenBazaarNode) CancelOfflineOrder(contract *pb.RicardianContract, reco return errors.New("cannot cancel order because utxo has already been spent") } - chaincode, err := hex.DecodeString(contract.BuyerOrder.Payment.Chaincode) + chaincode, err := hex.DecodeString(v5Order.Payment.Chaincode) if err != nil { return err } @@ -866,11 +908,11 @@ func (n *OpenBazaarNode) CancelOfflineOrder(contract *pb.RicardianContract, reco if err != nil { return err } - redeemScript, err := hex.DecodeString(contract.BuyerOrder.Payment.RedeemScript) + redeemScript, err := hex.DecodeString(v5Order.Payment.RedeemScript) if err != nil { return err } - refundAddress, err := wal.DecodeAddress(contract.BuyerOrder.RefundAddress) + refundAddress, err := wal.DecodeAddress(v5Order.RefundAddress) if err != nil { return err } @@ -982,7 +1024,7 @@ func (n *OpenBazaarNode) CalculateOrderTotal(contract *pb.RicardianContract) (*b } for _, vendorCoupon := range nrl.GetProtobuf().Coupons { if id.B58String() == vendorCoupon.GetHash() { - if disc, ok := new(big.Int).SetString(vendorCoupon.BigPriceDiscount, 10); ok && disc.Cmp(big.NewInt(0)) > 0 { + if disc, ok := new(big.Int).SetString(vendorCoupon.GetBigPriceDiscount(), 10); ok && disc.Cmp(big.NewInt(0)) > 0 { // apply fixed discount itemOriginAmt = itemOriginAmt.SubBigInt(disc) } else if discountF := vendorCoupon.GetPercentDiscount(); discountF > 0 { diff --git a/core/profile.go b/core/profile.go index 23f17a40c4..911c9ac1e9 100644 --- a/core/profile.go +++ b/core/profile.go @@ -52,6 +52,7 @@ func (n *OpenBazaarNode) FetchProfile(peerID string, useCache bool) (pb.Profile, } p, err := repo.UnmarshalJSONProfile(b) if err != nil { + log.Error("Profile fetch error", peerID, err) return pro, err } p.NormalizeDataForAllSchemas() diff --git a/ipfs/config.go b/ipfs/config.go index b041bd8008..f3ec28c7b9 100644 --- a/ipfs/config.go +++ b/ipfs/config.go @@ -15,7 +15,7 @@ import ( "github.com/ipfs/go-ipfs/repo" ) -var routerCacheURI string +//var routerCacheURI string // UpdateIPFSGlobalProtocolVars is a hack to manage custom protocol strings // which do not yet have an API to manage their configuration @@ -34,7 +34,7 @@ func UpdateIPFSGlobalProtocolVars(testnetEnable bool) { // PrepareIPFSConfig builds the configuration options for the internal // IPFS node. func PrepareIPFSConfig(r repo.Repo, routerAPIEndpoint string, testEnable, regtestEnable bool) *ipfscore.BuildCfg { - routerCacheURI = routerAPIEndpoint + //routerCacheURI = routerAPIEndpoint ncfg := &ipfscore.BuildCfg{ Repo: r, Online: true, diff --git a/net/service/handlers.go b/net/service/handlers.go index 34a4348770..fe255bf2c1 100644 --- a/net/service/handlers.go +++ b/net/service/handlers.go @@ -553,6 +553,14 @@ func (service *OpenBazaarService) handleOrderConfirmation(p peer.ID, pmes *pb.Me return nil, net.DuplicateMessage } + if state != pb.OrderState_PENDING { + log.Debugf("order state (%s) is not what is expected", state.String()) + if err := service.SendProcessingError(p.Pretty(), vendorContract.VendorOrderConfirmation.OrderID, pb.Message_ORDER_CONFIRMATION, contract); err != nil { + log.Errorf("failed sending ORDER_PROCESSING_FAILURE to peer (%s): %s", p.Pretty(), err) + } + return nil, net.OutOfOrderMessage + } + // Validate the order confirmation log.Debugf("validating order confirmation message") err = service.node.ValidateOrderConfirmation(vendorContract, false) @@ -1512,11 +1520,19 @@ func (service *OpenBazaarService) handleDisputeClose(p peer.ID, pmes *pb.Message return nil, err } + // If DisputeAcceptance is already set then move the state directly to RESOLVED if isPurchase { - // Set message state to complete - err = service.datastore.Purchases().Put(rc.DisputeResolution.OrderId, *contract, pb.OrderState_DECIDED, false) + if contract.DisputeAcceptance != nil { + err = service.datastore.Purchases().Put(rc.DisputeResolution.OrderId, *contract, pb.OrderState_RESOLVED, false) + } else { + err = service.datastore.Purchases().Put(rc.DisputeResolution.OrderId, *contract, pb.OrderState_DECIDED, false) + } } else { - err = service.datastore.Sales().Put(rc.DisputeResolution.OrderId, *contract, pb.OrderState_DECIDED, false) + if contract.DisputeAcceptance != nil { + err = service.datastore.Sales().Put(rc.DisputeResolution.OrderId, *contract, pb.OrderState_RESOLVED, false) + } else { + err = service.datastore.Sales().Put(rc.DisputeResolution.OrderId, *contract, pb.OrderState_DECIDED, false) + } } if err != nil { return nil, err diff --git a/pb/api.pb.go b/pb/api.pb.go index 6cf46c1dc9..ecf0f45ebe 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_691aa1834ba6a6f4, []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_691aa1834ba6a6f4, []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_691aa1834ba6a6f4, []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) @@ -286,16 +291,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_691aa1834ba6a6f4, []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) @@ -368,16 +374,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_691aa1834ba6a6f4, []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) @@ -415,16 +422,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_691aa1834ba6a6f4, []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) @@ -469,16 +477,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_691aa1834ba6a6f4, []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) @@ -520,9 +529,9 @@ func init() { proto.RegisterType((*RatingWithID)(nil), "RatingWithID") } -func init() { proto.RegisterFile("api.proto", fileDescriptor_api_691aa1834ba6a6f4) } +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } -var fileDescriptor_api_691aa1834ba6a6f4 = []byte{ +var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 670 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x6a, 0x1b, 0x3b, 0x10, 0xc6, 0xeb, 0xbf, 0xf5, 0x38, 0xf6, 0xe1, 0xe8, 0x84, 0xc3, 0x62, 0x38, 0x27, 0xee, 0xd2, diff --git a/pb/contracts.pb.go b/pb/contracts.pb.go index b4103910bf..4a0e81ed44 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_f6c2e11bd5cfebaf, []int{2, 0, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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_f6c2e11bd5cfebaf, []int{2, 0, 1} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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_f6c2e11bd5cfebaf, []int{2, 2, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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_f6c2e11bd5cfebaf, []int{3, 2, 0} + return fileDescriptor_b6d125f880f9ca35, []int{3, 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_f6c2e11bd5cfebaf, []int{19, 0} + return fileDescriptor_b6d125f880f9ca35, []int{19, 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_f6c2e11bd5cfebaf, []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) @@ -294,16 +307,17 @@ func (m *CurrencyDefinition) Reset() { *m = CurrencyDefinition{} } func (m *CurrencyDefinition) String() string { return proto.CompactTextString(m) } func (*CurrencyDefinition) ProtoMessage() {} func (*CurrencyDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_f6c2e11bd5cfebaf, []int{1} + return fileDescriptor_b6d125f880f9ca35, []int{1} } + func (m *CurrencyDefinition) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CurrencyDefinition.Unmarshal(m, b) } func (m *CurrencyDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_CurrencyDefinition.Marshal(b, m, deterministic) } -func (dst *CurrencyDefinition) XXX_Merge(src proto.Message) { - xxx_messageInfo_CurrencyDefinition.Merge(dst, src) +func (m *CurrencyDefinition) XXX_Merge(src proto.Message) { + xxx_messageInfo_CurrencyDefinition.Merge(m, src) } func (m *CurrencyDefinition) XXX_Size() int { return xxx_messageInfo_CurrencyDefinition.Size(m) @@ -348,16 +362,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_f6c2e11bd5cfebaf, []int{2} + return fileDescriptor_b6d125f880f9ca35, []int{2} } + 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) @@ -459,16 +474,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_f6c2e11bd5cfebaf, []int{2, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -583,16 +599,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_f6c2e11bd5cfebaf, []int{2, 1} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -722,16 +739,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_f6c2e11bd5cfebaf, []int{2, 1, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -775,16 +793,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_f6c2e11bd5cfebaf, []int{2, 1, 0, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -825,16 +844,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_f6c2e11bd5cfebaf, []int{2, 1, 1} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -905,16 +925,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_f6c2e11bd5cfebaf, []int{2, 1, 2} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -981,16 +1002,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_f6c2e11bd5cfebaf, []int{2, 2} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -1045,16 +1067,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_f6c2e11bd5cfebaf, []int{2, 2, 0} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -1123,16 +1146,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_f6c2e11bd5cfebaf, []int{2, 3} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -1176,29 +1200,32 @@ type Listing_Coupon struct { // Types that are valid to be assigned to Code: // *Listing_Coupon_Hash // *Listing_Coupon_DiscountCode - Code isListing_Coupon_Code `protobuf_oneof:"code"` - PercentDiscount float32 `protobuf:"fixed32,5,opt,name=percentDiscount,proto3" json:"percentDiscount,omitempty"` - PriceDiscount uint64 `protobuf:"varint,6,opt,name=priceDiscount,proto3" json:"priceDiscount,omitempty"` // Deprecated: Do not use. - BigPriceDiscount string `protobuf:"bytes,7,opt,name=bigPriceDiscount,proto3" json:"bigPriceDiscount,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Code isListing_Coupon_Code `protobuf_oneof:"code"` + // Types that are valid to be assigned to Discount: + // *Listing_Coupon_PercentDiscount + // *Listing_Coupon_PriceDiscount + // *Listing_Coupon_BigPriceDiscount + Discount isListing_Coupon_Discount `protobuf_oneof:"discount"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } 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_f6c2e11bd5cfebaf, []int{2, 4} + return fileDescriptor_b6d125f880f9ca35, []int{2, 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) @@ -1253,94 +1280,68 @@ func (m *Listing_Coupon) GetDiscountCode() string { return "" } -func (m *Listing_Coupon) GetPercentDiscount() float32 { +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"` +} + +type Listing_Coupon_BigPriceDiscount struct { + BigPriceDiscount string `protobuf:"bytes,7,opt,name=bigPriceDiscount,proto3,oneof"` +} + +func (*Listing_Coupon_PercentDiscount) isListing_Coupon_Discount() {} + +func (*Listing_Coupon_PriceDiscount) isListing_Coupon_Discount() {} + +func (*Listing_Coupon_BigPriceDiscount) isListing_Coupon_Discount() {} + +func (m *Listing_Coupon) GetDiscount() isListing_Coupon_Discount { if m != nil { - return m.PercentDiscount + return m.Discount + } + return nil +} + +func (m *Listing_Coupon) GetPercentDiscount() float32 { + if x, ok := m.GetDiscount().(*Listing_Coupon_PercentDiscount); ok { + return x.PercentDiscount } return 0 } // Deprecated: Do not use. func (m *Listing_Coupon) GetPriceDiscount() uint64 { - if m != nil { - return m.PriceDiscount + if x, ok := m.GetDiscount().(*Listing_Coupon_PriceDiscount); ok { + return x.PriceDiscount } return 0 } func (m *Listing_Coupon) GetBigPriceDiscount() string { - if m != nil { - return m.BigPriceDiscount + if x, ok := m.GetDiscount().(*Listing_Coupon_BigPriceDiscount); ok { + return x.BigPriceDiscount } return "" } -// 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), + (*Listing_Coupon_PriceDiscount)(nil), + (*Listing_Coupon_BigPriceDiscount)(nil), } } -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) - } - 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 - 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)) - } - 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"` // Deprecated: Do not use. @@ -1362,16 +1363,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_f6c2e11bd5cfebaf, []int{3} + return fileDescriptor_b6d125f880f9ca35, []int{3} } + 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) @@ -1477,16 +1479,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_f6c2e11bd5cfebaf, []int{3, 0} + return fileDescriptor_b6d125f880f9ca35, []int{3, 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) @@ -1565,16 +1568,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_f6c2e11bd5cfebaf, []int{3, 1} + return fileDescriptor_b6d125f880f9ca35, []int{3, 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) @@ -1662,16 +1666,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_f6c2e11bd5cfebaf, []int{3, 1, 0} + return fileDescriptor_b6d125f880f9ca35, []int{3, 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) @@ -1708,16 +1713,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_f6c2e11bd5cfebaf, []int{3, 1, 1} + return fileDescriptor_b6d125f880f9ca35, []int{3, 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) @@ -1762,16 +1768,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_f6c2e11bd5cfebaf, []int{3, 2} + return fileDescriptor_b6d125f880f9ca35, []int{3, 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) @@ -1872,16 +1879,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_f6c2e11bd5cfebaf, []int{4} + return fileDescriptor_b6d125f880f9ca35, []int{4} } + 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) @@ -1955,16 +1963,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_f6c2e11bd5cfebaf, []int{5} + return fileDescriptor_b6d125f880f9ca35, []int{5} } + 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) @@ -2008,16 +2017,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_f6c2e11bd5cfebaf, []int{6} + return fileDescriptor_b6d125f880f9ca35, []int{6} } + 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) @@ -2057,16 +2067,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_f6c2e11bd5cfebaf, []int{6, 0} + return fileDescriptor_b6d125f880f9ca35, []int{6, 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) @@ -2129,16 +2140,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_f6c2e11bd5cfebaf, []int{6, 0, 0} + return fileDescriptor_b6d125f880f9ca35, []int{6, 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) @@ -2196,16 +2208,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_f6c2e11bd5cfebaf, []int{7} + return fileDescriptor_b6d125f880f9ca35, []int{7} } + 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) @@ -2236,7 +2249,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"` @@ -2253,16 +2266,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_f6c2e11bd5cfebaf, []int{8} + return fileDescriptor_b6d125f880f9ca35, []int{8} } + 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) @@ -2348,16 +2362,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_f6c2e11bd5cfebaf, []int{8, 0} + return fileDescriptor_b6d125f880f9ca35, []int{8, 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) @@ -2394,16 +2409,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_f6c2e11bd5cfebaf, []int{8, 1} + return fileDescriptor_b6d125f880f9ca35, []int{8, 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) @@ -2441,16 +2457,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_f6c2e11bd5cfebaf, []int{8, 2} + return fileDescriptor_b6d125f880f9ca35, []int{8, 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) @@ -2483,16 +2500,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_f6c2e11bd5cfebaf, []int{8, 3} + return fileDescriptor_b6d125f880f9ca35, []int{8, 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) @@ -2553,16 +2571,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_f6c2e11bd5cfebaf, []int{9} + return fileDescriptor_b6d125f880f9ca35, []int{9} } + 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) @@ -2614,16 +2633,17 @@ func (m *OrderProcessingFailure) Reset() { *m = OrderProcessingFailure{} func (m *OrderProcessingFailure) String() string { return proto.CompactTextString(m) } func (*OrderProcessingFailure) ProtoMessage() {} func (*OrderProcessingFailure) Descriptor() ([]byte, []int) { - return fileDescriptor_contracts_f6c2e11bd5cfebaf, []int{10} + return fileDescriptor_b6d125f880f9ca35, []int{10} } + func (m *OrderProcessingFailure) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderProcessingFailure.Unmarshal(m, b) } func (m *OrderProcessingFailure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OrderProcessingFailure.Marshal(b, m, deterministic) } -func (dst *OrderProcessingFailure) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderProcessingFailure.Merge(dst, src) +func (m *OrderProcessingFailure) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderProcessingFailure.Merge(m, src) } func (m *OrderProcessingFailure) XXX_Size() int { return xxx_messageInfo_OrderProcessingFailure.Size(m) @@ -2667,16 +2687,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_f6c2e11bd5cfebaf, []int{11} + return fileDescriptor_b6d125f880f9ca35, []int{11} } + 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) @@ -2725,16 +2746,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_f6c2e11bd5cfebaf, []int{11, 0} + return fileDescriptor_b6d125f880f9ca35, []int{11, 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) @@ -2858,16 +2880,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_f6c2e11bd5cfebaf, []int{12} + return fileDescriptor_b6d125f880f9ca35, []int{12} } + 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) @@ -2929,16 +2952,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_f6c2e11bd5cfebaf, []int{13} + return fileDescriptor_b6d125f880f9ca35, []int{13} } + 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) @@ -3007,16 +3031,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_f6c2e11bd5cfebaf, []int{13, 0} + return fileDescriptor_b6d125f880f9ca35, []int{13, 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) @@ -3085,16 +3110,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_f6c2e11bd5cfebaf, []int{13, 0, 0} + return fileDescriptor_b6d125f880f9ca35, []int{13, 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) @@ -3157,72 +3183,14 @@ func (m *DisputeResolution_Payout_Output) GetBigAmount() string { return "" } -// 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"` @@ -3235,16 +3203,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_f6c2e11bd5cfebaf, []int{14} + return fileDescriptor_b6d125f880f9ca35, []int{14} } + 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) @@ -3283,16 +3252,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_f6c2e11bd5cfebaf, []int{15} + return fileDescriptor_b6d125f880f9ca35, []int{15} } + 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) @@ -3347,16 +3317,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_f6c2e11bd5cfebaf, []int{16} + return fileDescriptor_b6d125f880f9ca35, []int{16} } + 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) @@ -3416,16 +3387,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_f6c2e11bd5cfebaf, []int{16, 0} + return fileDescriptor_b6d125f880f9ca35, []int{16, 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) @@ -3476,16 +3448,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_f6c2e11bd5cfebaf, []int{17} + return fileDescriptor_b6d125f880f9ca35, []int{17} } + 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) @@ -3517,16 +3490,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_f6c2e11bd5cfebaf, []int{18} + return fileDescriptor_b6d125f880f9ca35, []int{18} } + 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) @@ -3577,16 +3551,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_f6c2e11bd5cfebaf, []int{18, 0} + return fileDescriptor_b6d125f880f9ca35, []int{18, 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) @@ -3623,16 +3598,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_f6c2e11bd5cfebaf, []int{19} + return fileDescriptor_b6d125f880f9ca35, []int{19} } + 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) @@ -3670,16 +3646,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_f6c2e11bd5cfebaf, []int{20} + return fileDescriptor_b6d125f880f9ca35, []int{20} } + 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) @@ -3712,6 +3689,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((*CurrencyDefinition)(nil), "CurrencyDefinition") proto.RegisterType((*Listing)(nil), "Listing") @@ -3759,243 +3741,239 @@ 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_f6c2e11bd5cfebaf) } - -var fileDescriptor_contracts_f6c2e11bd5cfebaf = []byte{ - // 3645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x3a, 0x4b, 0x93, 0x1b, 0x57, - 0x57, 0x6e, 0xbd, 0x75, 0xa4, 0x19, 0x69, 0xae, 0xe7, 0x1b, 0x0b, 0x55, 0xb0, 0xc7, 0x5d, 0xfe, - 0xc2, 0x7c, 0x89, 0xd3, 0x71, 0x86, 0x54, 0xca, 0x21, 0x54, 0x92, 0x19, 0x49, 0x93, 0x11, 0x9e, - 0x87, 0x72, 0x25, 0x1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0xa4, 0x2e, 0xe5, 0x87, 0x47, 0x50, 0x60, 0x06, 0xdb, 0x32, 0x76, 0x8d, 0xbd, 0x2a, 0xe6, 0xcf, - 0xc8, 0x84, 0xba, 0x43, 0xaf, 0x69, 0x40, 0x2f, 0xe8, 0x94, 0x86, 0x0b, 0x6e, 0x3f, 0x1b, 0x38, - 0x85, 0x33, 0xff, 0xfe, 0x0e, 0x94, 0xa5, 0xb9, 0xb1, 0x3d, 0x82, 0x69, 0x34, 0x51, 0x7b, 0xb0, - 0x67, 0x74, 0x0f, 0x2a, 0x42, 0xb5, 0xfd, 0xae, 0xb4, 0xbf, 0xbc, 0xd5, 0xef, 0x62, 0x8d, 0x44, - 0xef, 0x41, 0x65, 0x46, 0x42, 0xdb, 0xb1, 0x43, 0x5b, 0xda, 0xda, 0x96, 0x32, 0x67, 0xeb, 0x54, - 0x12, 0xb0, 0x66, 0x41, 0xf7, 0xa1, 0x40, 0x43, 0x32, 0x6b, 0x15, 0x38, 0xeb, 0x86, 0x66, 0xed, - 0x87, 0x64, 0x86, 0x39, 0x09, 0x1d, 0x40, 0x23, 0xb8, 0xa2, 0xf3, 0x39, 0x75, 0x27, 0xe7, 0x73, - 0x76, 0xb9, 0xa0, 0x55, 0xe4, 0x92, 0xba, 0xa3, 0xb9, 0x87, 0x29, 0x3a, 0xce, 0xf2, 0x23, 0x13, - 0x8a, 0xa1, 0x7d, 0x43, 0x82, 0x56, 0x89, 0x2f, 0xac, 0xeb, 0x85, 0x23, 0xfb, 0x06, 0x0b, 0x12, - 0xfa, 0x15, 0x94, 0xc7, 0x5e, 0x34, 0x67, 0xdb, 0x97, 0x39, 0x57, 0x43, 0x73, 0x75, 0x38, 0x1e, - 0x2b, 0x3a, 0xba, 0x0b, 0x30, 0xf3, 0x1c, 0xe2, 0xdb, 0x21, 0x53, 0x47, 0x85, 0xab, 0x23, 0x81, - 0x41, 0x16, 0xa0, 0x90, 0xf8, 0xb3, 0xe0, 0xc0, 0x75, 0x3a, 0x9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ad, 0x92, 0xa8, 0x54, 0x62, 0xe4, 0xed, 0x68, 0x26, 0x31, 0x3e, 0x8c, - 0xab, 0x27, 0x51, 0x27, 0xa0, 0x84, 0x01, 0x2c, 0xd5, 0x4e, 0x87, 0xb0, 0x99, 0xee, 0xfc, 0x74, - 0x3b, 0x92, 0x58, 0x94, 0xe9, 0x15, 0x33, 0x2b, 0x98, 0x48, 0x67, 0x64, 0xe6, 0x49, 0x11, 0xf1, - 0x67, 0x76, 0x0f, 0xd1, 0xfa, 0x31, 0x59, 0xa8, 0xfa, 0x32, 0x89, 0xe2, 0x05, 0xad, 0x30, 0x32, - 0xe5, 0x75, 0x65, 0x59, 0xd0, 0xa6, 0xb0, 0xc8, 0x04, 0x50, 0x77, 0xfb, 0xe8, 0x43, 0xde, 0x72, - 0x08, 0xbf, 0x4b, 0x60, 0xb3, 0x89, 0xbe, 0xba, 0x9c, 0xe8, 0xf7, 0x5f, 0x59, 0x7e, 0x6d, 0x43, - 0xf1, 0xda, 0x9e, 0x46, 0x44, 0x1a, 0x8b, 0x00, 0xda, 0x9f, 0xbe, 0x56, 0x06, 0x6e, 0x41, 0x59, - 0xa6, 0x3b, 0x65, 0x6a, 0x12, 0x6c, 0xff, 0x4d, 0x1e, 0xca, 0xd2, 0xa1, 0xd0, 0x7b, 0xac, 0x20, - 0x08, 0xaf, 0x3c, 0x87, 0xaf, 0xdd, 0xdc, 0xff, 0x45, 0xda, 0xe1, 0x58, 0x9b, 0x78, 0xe5, 0x39, - 0x58, 0x32, 0xb1, 0xea, 0x49, 0x37, 0xc7, 0xaa, 0x7a, 0xd2, 0x08, 0xd4, 0x86, 0x92, 0x3d, 0xe3, - 0x31, 0x2e, 0xaf, 0xc5, 0x21, 0x31, 0xbc, 0xb4, 0xbe, 0xb2, 0xa9, 0xcb, 0x47, 0x19, 0x05, 0x59, - 0x5a, 0x2b, 0x44, 0xd2, 0x2f, 0x8a, 0x69, 0xbf, 0xe0, 0x0d, 0xb5, 0x43, 0xc8, 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2, 0x26, - 0xe4, 0x23, 0x7f, 0x2a, 0x37, 0x64, 0x8f, 0xcc, 0xcc, 0xe7, 0x76, 0x10, 0xbc, 0xf4, 0x7c, 0x47, - 0x8d, 0x21, 0x14, 0xdc, 0xfe, 0x14, 0x76, 0x56, 0x5f, 0x84, 0x35, 0x37, 0x61, 0xec, 0xa5, 0x3a, - 0xb8, 0xa6, 0x91, 0xed, 0x1f, 0x0d, 0x28, 0x09, 0xdd, 0xe8, 0x98, 0x69, 0xbc, 0x32, 0x66, 0xf2, - 0x71, 0x1a, 0x5f, 0x70, 0x90, 0x2a, 0xb4, 0xd3, 0x48, 0x64, 0x41, 0x53, 0x20, 0x8e, 0x08, 0x19, - 0x10, 0xff, 0x70, 0x11, 0x92, 0x44, 0xd1, 0xb2, 0x44, 0x43, 0x8f, 0xe0, 0x36, 0x6b, 0xd8, 0xb2, - 0x4b, 0x84, 0xbb, 0xaf, 0x22, 0xa1, 0x03, 0xd8, 0xd2, 0xbb, 0xe8, 0x7c, 0x54, 0x5c, 0x9f, 0x8f, - 0x96, 0xb9, 0xcd, 0x7f, 0x30, 0xa0, 0x91, 0xfd, 0x60, 0xb6, 0xde, 0xa1, 0x7f, 0x7e, 0x36, 0xfa, - 0x00, 0x40, 0xbc, 0x7c, 0xf8, 0xca, 0x9c, 0x94, 0x60, 0x42, 0xf7, 0xa1, 0x2c, 0xec, 0x3e, 0x90, - 0x6e, 0x5e, 0x96, 0x8e, 0x81, 0x15, 0xde, 0xfc, 0x5b, 0x03, 0x76, 0xf8, 0xe9, 0x07, 0x7a, 0x12, - 0x7c, 0x64, 0xd3, 0x29, 0x73, 0x91, 0xf5, 0x29, 0xf5, 0x18, 0xb6, 0xed, 0x30, 0x24, 0xb3, 0x79, - 0x48, 0x9c, 0x53, 0xf1, 0x65, 0x36, 0xf1, 0xf1, 0x63, 0xdb, 0x92, 0x38, 0x2b, 0x41, 0xc3, 0x2b, - 0x57, 0x20, 0x0b, 0x2a, 0xea, 0x53, 0x88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91, 0xc1, 0x36, - 0x14, 0xc7, 0x53, 0x9b, 0xce, 0x54, 0x19, 0xc2, 0x81, 0xe5, 0x18, 0x97, 0x5f, 0x15, 0xe3, 0x7e, - 0x0b, 0xaa, 0x5e, 0x14, 0xce, 0x3d, 0xea, 0x86, 0xca, 0x4b, 0xab, 0xd6, 0xb9, 0xc4, 0xe0, 0x98, - 0xc6, 0x0a, 0xee, 0x80, 0xf8, 0xd4, 0x9e, 0xd2, 0x3f, 0x26, 0x8e, 0x72, 0x0d, 0x6e, 0x09, 0x75, - 0xbc, 0x82, 0x62, 0xfe, 0x59, 0x09, 0xb6, 0x96, 0xbe, 0xbb, 0xff, 0x1f, 0x2e, 0x99, 0x88, 0x69, - 0xb9, 0x74, 0x4c, 0xbb, 0x0b, 0x30, 0xf7, 0xbd, 0xb9, 0x17, 0x10, 0xe7, 0x50, 0xcd, 0x46, 0x12, - 0x18, 0x3e, 0x06, 0x8a, 0xff, 0x13, 0x20, 0xa2, 0x71, 0x02, 0x83, 0x3e, 0xd0, 0x99, 0x5f, 0x44, - 0xde, 0xdf, 0x58, 0xfe, 0xbf, 0x40, 0x36, 0xf5, 0x3f, 0x82, 0xdb, 0xda, 0x7e, 0xb5, 0x4f, 0x89, - 0x49, 0x41, 0x1d, 0xaf, 0x22, 0xb5, 0xff, 0x2b, 0xff, 0xa6, 0x39, 0xea, 0x3e, 0x94, 0x78, 0x59, - 0x27, 0x66, 0xa6, 0x29, 0xb5, 0x48, 0x02, 0x3a, 0x84, 0x9a, 0xf8, 0xc3, 0x44, 0x14, 0xce, 0x23, - 0x15, 0xc1, 0x76, 0xd7, 0x1e, 0xdf, 0x12, 0x7c, 0x38, 0xb9, 0x08, 0x75, 0xa1, 0x2e, 0xff, 0xbc, - 0x21, 0x36, 0x29, 0xbc, 0xe6, 0x26, 0xa9, 0x55, 0xe8, 0xf7, 0xa0, 0xa1, 0x6f, 0x2d, 0x37, 0x2a, - 0xbe, 0xe6, 0x46, 0xd9, 0x85, 0x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0x16, 0x1f, 0xfa, 0x18, 0x36, - 0x38, 0x93, 0xb6, 0xef, 0xc2, 0x2b, 0x3e, 0xc5, 0xa6, 0x38, 0xcd, 0x7d, 0xd8, 0x79, 0xc6, 0xfd, - 0xee, 0x88, 0x35, 0x88, 0x2c, 0xe0, 0xaa, 0x21, 0xdd, 0x5a, 0x45, 0x98, 0xff, 0x68, 0x40, 0xae, - 0xdf, 0x65, 0x39, 0x68, 0x4e, 0x12, 0x74, 0x09, 0x31, 0xfc, 0x95, 0xed, 0x3a, 0x53, 0x35, 0x02, - 0x94, 0x10, 0xfa, 0x25, 0x94, 0xe7, 0xd1, 0xc5, 0x0b, 0xb2, 0x08, 0x64, 0x60, 0xa9, 0x59, 0xfd, - 0xae, 0x35, 0x10, 0x28, 0xac, 0x68, 0x2c, 0xba, 0x5e, 0x68, 0xfd, 0xf0, 0x9b, 0xd4, 0x71, 0x02, - 0xd3, 0xfe, 0x0c, 0xca, 0x72, 0x0d, 0x93, 0x09, 0x75, 0x88, 0x18, 0x73, 0x8a, 0x82, 0x46, 0xc3, - 0xec, 0xf8, 0x72, 0x91, 0x2c, 0x8c, 0x14, 0x68, 0xfe, 0x8f, 0x01, 0xd5, 0xb8, 0x71, 0x7a, 0x08, - 0xe5, 0x80, 0x08, 0x55, 0x8b, 0x61, 0x24, 0x8a, 0xff, 0x3f, 0x65, 0x0d, 0x05, 0x05, 0x2b, 0x16, - 0xd6, 0xc2, 0xe8, 0xfa, 0x8a, 0x15, 0xdc, 0x81, 0xdc, 0x3c, 0x83, 0x35, 0xbf, 0xe5, 0x9f, 0xfa, - 0xc4, 0x9a, 0x1a, 0x94, 0x4f, 0xfa, 0xc3, 0x51, 0xff, 0xec, 0x8b, 0xe6, 0x2d, 0x54, 0x85, 0xe2, - 0x39, 0xee, 0xf6, 0x70, 0xd3, 0x40, 0x3b, 0x80, 0xf8, 0xe3, 0xf3, 0xce, 0xf9, 0xd9, 0x51, 0x1f, - 0x9f, 0x1e, 0x8c, 0xfa, 0xe7, 0x67, 0xcd, 0x1c, 0xfa, 0x05, 0x6c, 0x09, 0xfc, 0xd1, 0xd3, 0x93, - 0xa3, 0xfe, 0xc9, 0xc9, 0x69, 0xef, 0x6c, 0xd4, 0xcc, 0xa3, 0x6d, 0x68, 0x2a, 0xf6, 0xd3, 0xc1, - 0x49, 0x8f, 0x33, 0x17, 0xd8, 0xe6, 0xdd, 0xfe, 0x70, 0xf0, 0x74, 0xd4, 0x6b, 0x16, 0xd9, 0x8e, - 0x12, 0x78, 0x8e, 0x7b, 0xc3, 0xf3, 0x93, 0xa7, 0x9c, 0xa9, 0x84, 0x00, 0x4a, 0xb8, 0xc7, 0xff, - 0xbc, 0x51, 0x36, 0x09, 0x6c, 0xb0, 0xfb, 0x11, 0x47, 0xfd, 0x4b, 0xcb, 0x84, 0xb2, 0x1c, 0x75, - 0xc8, 0xd8, 0x11, 0xff, 0x7d, 0x50, 0x11, 0xb4, 0xff, 0xe7, 0x12, 0xfe, 0x9f, 0xaa, 0x3d, 0xf3, - 0x99, 0xda, 0xf3, 0xb0, 0xf0, 0x87, 0xb9, 0xf9, 0xc5, 0x45, 0x89, 0xfb, 0xe5, 0x6f, 0xff, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xc3, 0x3b, 0x5c, 0x15, 0x29, 0x00, 0x00, +func init() { proto.RegisterFile("contracts.proto", fileDescriptor_b6d125f880f9ca35) } + +var fileDescriptor_b6d125f880f9ca35 = []byte{ + // 3661 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x3a, 0x4b, 0x8f, 0x23, 0xd7, + 0x5a, 0x53, 0x7e, 0xfb, 0xb3, 0xbb, 0xed, 0x3e, 0xd3, 0xb7, 0xc7, 0x58, 0x61, 0xa6, 0xa7, 0x34, + 0x37, 0xf4, 0x9d, 0xf4, 0xad, 0x3b, 0x69, 0xae, 0xae, 0xe6, 0x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x6f, 0x87, 0x4c, 0x1d, 0x15, 0xae, + 0x8e, 0x04, 0x06, 0x59, 0x80, 0x42, 0xe2, 0xcf, 0x82, 0x43, 0xd7, 0xe9, 0x78, 0xae, 0x43, 0xc5, + 0xa1, 0xab, 0x5c, 0x8c, 0x2b, 0x28, 0x4c, 0x31, 0xc2, 0x20, 0x06, 0xde, 0x94, 0x8e, 0x17, 0x2d, + 0xe0, 0x9c, 0x29, 0x5c, 0xfb, 0x2f, 0x8a, 0x50, 0x51, 0xf2, 0x43, 0x2d, 0x28, 0xdf, 0x10, 0x3f, + 0x60, 0x26, 0x6d, 0x70, 0x25, 0x2a, 0x10, 0x1d, 0x41, 0x5d, 0x05, 0xb0, 0xd1, 0x62, 0x4e, 0xb8, + 0x8e, 0x36, 0x0f, 0xee, 0x2f, 0xa9, 0xc0, 0xea, 0x24, 0xb8, 0x70, 0x6a, 0x0d, 0x7a, 0x02, 0xa5, + 0x2b, 0x8f, 0x39, 0x3f, 0x57, 0xe0, 0xe6, 0x41, 0x6b, 0x79, 0xf5, 0x31, 0xa7, 0x63, 0xc9, 0x87, + 0x0e, 0xa0, 0x44, 0x6e, 0xe7, 0xd4, 0x5f, 0x48, 0x3d, 0xb6, 0x2d, 0x11, 0x11, 0x2d, 0x15, 0x11, + 0xad, 0x91, 0x8a, 0x88, 0x58, 0x72, 0x32, 0x21, 0xd9, 0xdc, 0x55, 0x88, 0x23, 0xed, 0x97, 0x12, + 0xa1, 0xd9, 0x2a, 0x5e, 0x41, 0x41, 0xfb, 0xd0, 0x98, 0xfb, 0x74, 0x4c, 0xdd, 0x89, 0x32, 0x77, + 0xee, 0xfc, 0xd5, 0xa3, 0x5c, 0xcb, 0xc0, 0x59, 0x12, 0x6a, 0x43, 0x65, 0x6a, 0xbb, 0x93, 0xc8, + 0x9e, 0x10, 0xee, 0xf5, 0x55, 0xac, 0x61, 0xf6, 0x66, 0x12, 0x8c, 0x7d, 0xef, 0x35, 0x3b, 0x94, + 0x17, 0x85, 0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0xf9, 0xb4, 0x3f, 0x1c, 0xf5, 0xcf, 0x3f, 0x6d, 0xde, 0x41, 0x55, 0x28, + 0x5e, 0xe0, 0x6e, 0x0f, 0x37, 0x0d, 0xb4, 0x03, 0x88, 0x3f, 0xbe, 0xec, 0x5c, 0x9c, 0x1f, 0xf7, + 0xf1, 0xd9, 0xe1, 0xa8, 0x7f, 0x71, 0xde, 0xcc, 0xa1, 0x1f, 0xc1, 0x96, 0xc0, 0x1f, 0x3f, 0x3f, + 0x3d, 0xee, 0x9f, 0x9e, 0x9e, 0xf5, 0xce, 0x47, 0xcd, 0x3c, 0xda, 0x86, 0xa6, 0x62, 0x3f, 0x1b, + 0x9c, 0xf6, 0x38, 0x73, 0x81, 0x6d, 0xde, 0xed, 0x0f, 0x07, 0xcf, 0x47, 0xbd, 0x66, 0x91, 0xed, + 0x28, 0x81, 0x97, 0xb8, 0x37, 0xbc, 0x38, 0x7d, 0xce, 0x99, 0x4a, 0x08, 0xa0, 0x84, 0x7b, 0xfc, + 0xef, 0x1c, 0x65, 0x93, 0xc0, 0x06, 0xbb, 0x1f, 0x71, 0xd4, 0xff, 0xb6, 0x4c, 0x28, 0xcb, 0x51, + 0x87, 0x8c, 0x1d, 0xf1, 0x1f, 0x0a, 0x15, 0x41, 0xfb, 0x7f, 0x2e, 0xe1, 0xff, 0xa9, 0xda, 0x33, + 0x9f, 0xa9, 0x3d, 0x8f, 0x0a, 0x7f, 0x98, 0x9b, 0x5f, 0x5e, 0x96, 0xb8, 0x5f, 0xfe, 0xf6, 0xff, + 0x06, 0x00, 0x00, 0xff, 0xff, 0x96, 0xe1, 0x7f, 0x57, 0x27, 0x29, 0x00, 0x00, } 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 e64c84088b..073038f1e6 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 @@ -75,6 +77,7 @@ var Message_MessageType_name = map[int32]string{ 500: "ERROR", 501: "ORDER_PROCESSING_FAILURE", } + var Message_MessageType_value = map[string]int32{ "PING": 0, "CHAT": 1, @@ -105,8 +108,9 @@ var Message_MessageType_value = map[string]int32{ func (x Message_MessageType) String() string { return proto.EnumName(Message_MessageType_name, int32(x)) } + func (Message_MessageType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_message_9461cb3f76d04d41, []int{0, 0} + return fileDescriptor_33c57e4bae7b9afd, []int{0, 0} } type Chat_Flag int32 @@ -122,6 +126,7 @@ var Chat_Flag_name = map[int32]string{ 1: "TYPING", 2: "READ", } + var Chat_Flag_value = map[string]int32{ "MESSAGE": 0, "TYPING": 1, @@ -131,8 +136,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_9461cb3f76d04d41, []int{2, 0} + return fileDescriptor_33c57e4bae7b9afd, []int{2, 0} } type Message struct { @@ -149,16 +155,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_9461cb3f76d04d41, []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) @@ -210,16 +217,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_9461cb3f76d04d41, []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) @@ -266,16 +274,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_9461cb3f76d04d41, []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) @@ -334,16 +343,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_9461cb3f76d04d41, []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) @@ -388,16 +398,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_9461cb3f76d04d41, []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) @@ -440,16 +451,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_9461cb3f76d04d41, []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) @@ -479,16 +491,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_9461cb3f76d04d41, []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) @@ -526,16 +539,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_9461cb3f76d04d41, []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) @@ -581,16 +595,17 @@ 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_message_9461cb3f76d04d41, []int{7} + 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 (dst *OrderPaymentTxn) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderPaymentTxn.Merge(dst, src) +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) @@ -630,6 +645,8 @@ func (m *OrderPaymentTxn) GetWithInput() bool { } 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") @@ -639,13 +656,11 @@ func init() { proto.RegisterType((*Block)(nil), "Block") proto.RegisterType((*Error)(nil), "Error") proto.RegisterType((*OrderPaymentTxn)(nil), "OrderPaymentTxn") - 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_9461cb3f76d04d41) } +func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) } -var fileDescriptor_message_9461cb3f76d04d41 = []byte{ +var fileDescriptor_33c57e4bae7b9afd = []byte{ // 873 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x8f, 0xdb, 0x44, 0x14, 0xae, 0x63, 0x67, 0x93, 0xbc, 0x64, 0x77, 0x67, 0x87, 0x6d, 0x65, 0x56, 0x6d, 0x89, 0x2c, diff --git a/pb/moderator.pb.go b/pb/moderator.pb.go index 1bb9293b48..b4102f1525 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_693ca1f6a156447c, []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_693ca1f6a156447c, []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_693ca1f6a156447c, []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) @@ -182,16 +188,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_693ca1f6a156447c, []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) @@ -246,16 +253,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_693ca1f6a156447c, []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) @@ -295,16 +303,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_693ca1f6a156447c) } +func init() { proto.RegisterFile("moderator.proto", fileDescriptor_44f20453d9230215) } -var fileDescriptor_moderator_693ca1f6a156447c = []byte{ +var fileDescriptor_44f20453d9230215 = []byte{ // 469 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xdb, 0x8b, 0xd3, 0x40, 0x14, 0xc6, 0xcd, 0xa5, 0x5b, 0x73, 0xba, 0xdb, 0x2d, 0x23, 0x4a, 0x2c, 0x22, 0xa1, 0x88, 0xf6, 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 4cc25da0e4..20fd743a42 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"` @@ -48,16 +50,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_0226022e2946dd53, []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) @@ -215,16 +218,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_0226022e2946dd53, []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) @@ -276,16 +280,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_0226022e2946dd53, []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) @@ -332,16 +337,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_0226022e2946dd53, []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) @@ -402,16 +408,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_0226022e2946dd53, []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) @@ -473,16 +480,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_0226022e2946dd53, []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) @@ -544,9 +552,9 @@ func init() { proto.RegisterType((*Profile_Stats)(nil), "Profile.Stats") } -func init() { proto.RegisterFile("profile.proto", fileDescriptor_profile_0226022e2946dd53) } +func init() { proto.RegisterFile("profile.proto", fileDescriptor_744bf7a47b381504) } -var fileDescriptor_profile_0226022e2946dd53 = []byte{ +var fileDescriptor_744bf7a47b381504 = []byte{ // 716 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x94, 0xcf, 0x6e, 0xc3, 0x44, 0x10, 0xc6, 0xe5, 0xfc, 0x6d, 0x36, 0x49, 0x5b, 0x16, 0x54, 0xad, 0x2c, 0x04, 0x51, 0x55, 0x41, diff --git a/pb/protos/contracts.proto b/pb/protos/contracts.proto index e1ba78ceab..4cfedcd779 100644 --- a/pb/protos/contracts.proto +++ b/pb/protos/contracts.proto @@ -145,9 +145,11 @@ message Listing { string hash = 2; string discountCode = 3; } - float percentDiscount = 5; - uint64 priceDiscount = 6 [deprecated = true]; // prefer bigPriceDiscount - string bigPriceDiscount = 7; // added schema v5 + oneof discount { + float percentDiscount = 5; + uint64 priceDiscount = 6 [deprecated = true]; // prefer bigPriceDiscount + string bigPriceDiscount = 7; // added schema v5 + } } } diff --git a/qa/cancel_direct_offline.py b/qa/cancel_direct_offline.py index f05306d9cc..5d354efafc 100644 --- a/qa/cancel_direct_offline.py +++ b/qa/cancel_direct_offline.py @@ -30,16 +30,20 @@ def run_test(self): time.sleep(20) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + api_url = alice["gateway_url"] + "ob/listing" r = requests.post(api_url, data=json.dumps(listing_json, indent=4)) if r.status_code == 404: @@ -67,7 +71,7 @@ def run_test(self): time.sleep(4) # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "T" + self.cointype @@ -104,6 +108,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -149,7 +157,7 @@ def run_test(self): raise TestFailure("CancelDirectOfflineTest - FAIL: Bob failed to detect outgoing payment") # startup alice again - self.start_node(alice) + self.start_node(1, alice) self.send_bitcoin_cmd("generatetoaddress", 1, self.bitcoin_address) time.sleep(45) @@ -169,8 +177,12 @@ def run_test(self): resp = json.loads(r.text) confirmed = int(resp["confirmed"]) #unconfirmed = int(resp["unconfirmed"]) - if confirmed <= 50 - int(payment_amount["amount"]): - raise TestFailure("CancelDirectOfflineTest - FAIL: Bob failed to receive the multisig payout") + if self.buyer_version == 4: + if confirmed <= 50 - payment_amount: + raise TestFailure("CancelDirectOfflineTest - FAIL: Bob failed to receive the multisig payout") + else: + if confirmed <= 50 - int(payment_amount["amount"]): + raise TestFailure("CancelDirectOfflineTest - FAIL: Bob failed to receive the multisig payout") else: raise TestFailure("CancelDirectOfflineTest - FAIL: Failed to query Bob's balance") diff --git a/qa/chat_offline.py b/qa/chat_offline.py index 351f77d6af..f4897b501e 100644 --- a/qa/chat_offline.py +++ b/qa/chat_offline.py @@ -67,7 +67,7 @@ def run_test(self): raise TestFailure("ChatOfflineTest - FAIL: Did not record new conversation") # startup bob again - self.start_node(bob) + self.start_node(2, bob) time.sleep(45) # check bob saved message correctly @@ -123,4 +123,4 @@ def run_test(self): if __name__ == '__main__': print("Running ChatOfflineTest") - ChatOfflineTest().main(["--regtest", "--disableexchangerates"]) \ No newline at end of file + ChatOfflineTest().main(["--regtest", "--disableexchangerates"]) diff --git a/qa/complete_direct_online.py b/qa/complete_direct_online.py index 44c01dee10..7fcb792f33 100644 --- a/qa/complete_direct_online.py +++ b/qa/complete_direct_online.py @@ -30,16 +30,20 @@ def run_test(self): time.sleep(20) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "T" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["T" + self.cointype] + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + api_url = alice["gateway_url"] + "ob/listing" r = requests.post(api_url, data=json.dumps(listing_json, indent=4)) if r.status_code == 404: @@ -60,7 +64,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -106,6 +110,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -136,9 +144,9 @@ def run_test(self): raise TestFailure("CompleteDirectOnlineTest - FAIL: Alice failed to detect payment") if resp["funded"] == False: raise TestFailure("CompleteDirectOnlineTest - FAIL: Alice incorrectly saved as unfunded") - + # alice send order fulfillment - with open('testdata/fulfillment.json') as fulfillment_file: + with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file: fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict) fulfillment_json["orderId"] = orderId fulfillment_json["slug"] = slug diff --git a/qa/complete_disputed.py b/qa/complete_disputed.py index fafe83998f..a0c4afcee1 100644 --- a/qa/complete_disputed.py +++ b/qa/complete_disputed.py @@ -43,7 +43,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -56,16 +56,20 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + listing_json["moderators"] = [moderatorId] api_url = alice["gateway_url"] + "ob/listing" r = requests.post(api_url, data=json.dumps(listing_json, indent=4)) @@ -87,7 +91,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -135,6 +139,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -167,7 +175,7 @@ def run_test(self): raise TestFailure("CompleteDisputedTest - FAIL: Alice incorrectly saved as unfunded") # alice send order fulfillment - with open('testdata/fulfillment.json') as fulfillment_file: + with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file: fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict) fulfillment_json["orderId"] = orderId fulfillment_json["slug"] = slug @@ -179,7 +187,7 @@ def run_test(self): resp = json.loads(r.text) raise TestFailure("CompleteDisputedTest - FAIL: Fulfillment POST failed. Reason: %s", resp["reason"]) time.sleep(4) - + # Bob open dispute dispute = { "orderId": orderId, @@ -288,7 +296,12 @@ def run_test(self): resp = json.loads(r.text) confirmed = int(resp["confirmed"]) #unconfirmed = int(resp["unconfirmed"]) - if confirmed <= (generated_coins*100000000) - int(payment_amount["amount"]): + amt = 0 + if self.buyer_version == "v4": + amt = payment_amount + else: + amt = int(payment_amount["amount"]) + if confirmed <= (generated_coins*100000000) - amt: raise TestFailure("CompleteDisputedTest - FAIL: Bob failed to detect dispute payout") elif r.status_code == 404: raise TestFailure("CompleteDisputedTest - FAIL: Receive coins endpoint not found") diff --git a/qa/complete_moderated_online.py b/qa/complete_moderated_online.py index 7ab63e77cc..6db5fc4a7e 100644 --- a/qa/complete_moderated_online.py +++ b/qa/complete_moderated_online.py @@ -42,7 +42,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -55,15 +55,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] slug = listing_json["slug"] listing_json["moderators"] = [moderatorId] @@ -87,7 +90,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -135,6 +138,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -167,7 +174,7 @@ def run_test(self): raise TestFailure("CompleteModeratedOnlineTest - FAIL: Alice incorrectly saved as unfunded") # alice send order fulfillment - with open('testdata/fulfillment.json') as fulfillment_file: + with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file: fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict) fulfillment_json["slug"] = slug fulfillment_json["orderId"] = orderId @@ -199,7 +206,7 @@ def run_test(self): raise TestFailure("CompleteModeratedOnlineTest - FAIL: Alice failed to order fulfillment") # bob send order completion - with open('testdata/completion.json') as completion_file: + with open('testdata/'+ self.buyer_version +'/completion.json') as completion_file: completion_json = json.load(completion_file, object_pairs_hook=OrderedDict) completion_json["orderId"] = orderId completion_json["ratings"][0]["slug"] = slug diff --git a/qa/complete_moderated_with_timeout.py b/qa/complete_moderated_with_timeout.py index 0e2748a87c..58928abac3 100644 --- a/qa/complete_moderated_with_timeout.py +++ b/qa/complete_moderated_with_timeout.py @@ -42,7 +42,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -55,15 +55,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] slug = listing_json["slug"] listing_json["moderators"] = [moderatorId] @@ -88,7 +91,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -136,6 +139,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -168,7 +175,7 @@ def run_test(self): raise TestFailure("CompleteModeratedWithTimeout - FAIL: Alice incorrectly saved as unfunded") # alice send order fulfillment - with open('testdata/fulfillment.json') as fulfillment_file: + with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file: fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict) fulfillment_json["slug"] = slug fulfillment_json["orderId"] = orderId @@ -200,7 +207,7 @@ def run_test(self): raise TestFailure("CompleteModeratedWithTimeout - FAIL: Alice failed to order fulfillment") # bob send order completion - with open('testdata/completion.json') as completion_file: + with open('testdata/'+ self.buyer_version +'/completion.json') as completion_file: completion_json = json.load(completion_file, object_pairs_hook=OrderedDict) completion_json["orderId"] = orderId completion_json["ratings"][0]["slug"] = slug diff --git a/qa/dispute_close_buyer.py b/qa/dispute_close_buyer.py index 60b1296560..c02f6dbb0e 100644 --- a/qa/dispute_close_buyer.py +++ b/qa/dispute_close_buyer.py @@ -43,7 +43,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -56,15 +56,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] listing_json["moderators"] = [moderatorId] @@ -86,7 +89,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -134,6 +137,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -164,7 +171,7 @@ def run_test(self): raise TestFailure("DisputeCloseBuyerTest - FAIL: Alice failed to detect payment") if resp["funded"] == False: raise TestFailure("DisputeCloseBuyerTest - FAIL: Alice incorrectly saved as unfunded") - + # Bob open dispute dispute = { "orderId": orderId, @@ -273,7 +280,12 @@ def run_test(self): resp = json.loads(r.text) confirmed = int(resp["confirmed"]) #unconfirmed = int(resp["unconfirmed"]) - if confirmed <= (generated_coins*100000000) - int(payment_amount["amount"]): + amt = 0 + if self.buyer_version == "v4": + amt = payment_amount + else: + amt = int(payment_amount["amount"]) + if confirmed <= (generated_coins*100000000) - amt: raise TestFailure("DisputeCloseBuyerTest - FAIL: Bob failed to detect dispute payout") elif r.status_code == 404: raise TestFailure("DisputeCloseBuyerTest - FAIL: Receive coins endpoint not found") diff --git a/qa/dispute_close_split.py b/qa/dispute_close_split.py index fb0f8485ba..7b39a4fb07 100644 --- a/qa/dispute_close_split.py +++ b/qa/dispute_close_split.py @@ -43,7 +43,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -56,15 +56,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] listing_json["moderators"] = [moderatorId] @@ -86,7 +89,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -134,6 +137,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -273,7 +280,13 @@ def run_test(self): resp = json.loads(r.text) confirmed = int(resp["confirmed"]) unconfirmed = int(resp["unconfirmed"]) - if confirmed + unconfirmed <= (generated_coins*100000000) - int(payment_amount["amount"]): + amt = 0 + if self.buyer_version == "v4": + amt = payment_amount + else: + amt = int(payment_amount["amount"]) + + if confirmed + unconfirmed <= (generated_coins*100000000) - amt: raise TestFailure("DisputeCloseSplitTest - FAIL: Bob failed to detect dispute payout") elif r.status_code == 404: raise TestFailure("DisputeCloseSplitTest - FAIL: Receive coins endpoint not found") diff --git a/qa/dispute_close_vendor.py b/qa/dispute_close_vendor.py index 9ade33d6a7..86b9bc4025 100644 --- a/qa/dispute_close_vendor.py +++ b/qa/dispute_close_vendor.py @@ -43,7 +43,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -56,15 +56,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] listing_json["moderators"] = [moderatorId] @@ -88,7 +91,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version+'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -136,6 +139,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -168,7 +175,7 @@ def run_test(self): raise TestFailure("DisputeCloseVendorTest - FAIL: Alice incorrectly saved as unfunded") # alice send order fulfillment - with open('testdata/fulfillment.json') as fulfillment_file: + with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file: fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict) fulfillment_json["orderId"] = orderId fulfillment_json["slug"] = slug @@ -198,7 +205,7 @@ def run_test(self): resp = json.loads(r.text) if resp["state"] != "FULFILLED": raise TestFailure("FulfillDirectOnlineTest - FAIL: Alice failed to order fulfillment") - + # Alice open dispute dispute = { "orderId": orderId, @@ -297,7 +304,7 @@ def run_test(self): time.sleep(20) self.send_bitcoin_cmd("generate", 1) - time.sleep(2) + time.sleep(20) # Check alice received payout api_url = alice["gateway_url"] + "wallet/balance/T" + self.cointype diff --git a/qa/escrow_release_after_timeout.py b/qa/escrow_release_after_timeout.py index 26b8c1e282..ebda8ba9b1 100644 --- a/qa/escrow_release_after_timeout.py +++ b/qa/escrow_release_after_timeout.py @@ -42,7 +42,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -55,15 +55,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] slug = listing_json["slug"] listing_json["moderators"] = [moderatorId] @@ -88,7 +91,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -136,6 +139,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -168,7 +175,7 @@ def run_test(self): raise TestFailure("EscrowTimeoutRelease - FAIL: Alice incorrectly saved as unfunded") # alice send order fulfillment - with open('testdata/fulfillment.json') as fulfillment_file: + with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file: fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict) fulfillment_json["slug"] = slug fulfillment_json["orderId"] = orderId diff --git a/qa/eth_cancel_direct_offline.py b/qa/eth_cancel_direct_offline.py index 92fcdd38dd..23dbe65c2c 100644 --- a/qa/eth_cancel_direct_offline.py +++ b/qa/eth_cancel_direct_offline.py @@ -147,7 +147,7 @@ def run_test(self): raise TestFailure("EthCancelDirectOfflineTest - FAIL: Bob failed to save as canceled") # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(160) # check alice detected order diff --git a/qa/eth_purchase_direct_offline.py b/qa/eth_purchase_direct_offline.py index 4fb1302e64..30194be512 100644 --- a/qa/eth_purchase_direct_offline.py +++ b/qa/eth_purchase_direct_offline.py @@ -129,7 +129,7 @@ def run_test(self): # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(60) # check alice detected order and payment diff --git a/qa/eth_purchase_moderated_offline.py b/qa/eth_purchase_moderated_offline.py index 5b63681ea1..915792ac96 100644 --- a/qa/eth_purchase_moderated_offline.py +++ b/qa/eth_purchase_moderated_offline.py @@ -155,7 +155,7 @@ def run_test(self): raise TestFailure("EthPurchaseModeratedOfflineTest - FAIL: Bob purchase saved in incorrect state") # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(80) # check alice detected order and payment diff --git a/qa/eth_purchase_offline_error.py b/qa/eth_purchase_offline_error.py index 417c31892f..d6ba75b1a9 100644 --- a/qa/eth_purchase_offline_error.py +++ b/qa/eth_purchase_offline_error.py @@ -100,7 +100,7 @@ def run_test(self): raise TestFailure("EthPurchaseOfflineErrorTest - FAIL: Bob incorrectly saved as funded") # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(45) # check alice detected processing error diff --git a/qa/eth_reject_direct_offline.py b/qa/eth_reject_direct_offline.py index 3a59b79497..066a1ec81b 100644 --- a/qa/eth_reject_direct_offline.py +++ b/qa/eth_reject_direct_offline.py @@ -128,7 +128,7 @@ def run_test(self): raise TestFailure("EthRejectDirectOfflineTest - FAIL: Bob purchase saved in incorrect state") # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(60) # alice reject order diff --git a/qa/eth_reject_moderated_offline.py b/qa/eth_reject_moderated_offline.py index a3fe76fa6e..7add9f8212 100644 --- a/qa/eth_reject_moderated_offline.py +++ b/qa/eth_reject_moderated_offline.py @@ -156,7 +156,7 @@ def run_test(self): # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(45) # alice reject order diff --git a/qa/fulfill_direct_online.py b/qa/fulfill_direct_online.py index fad75a85dc..1f7524e4ab 100644 --- a/qa/fulfill_direct_online.py +++ b/qa/fulfill_direct_online.py @@ -30,15 +30,18 @@ def run_test(self): time.sleep(20) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] api_url = alice["gateway_url"] + "ob/listing" @@ -61,7 +64,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -107,6 +110,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -137,9 +144,9 @@ def run_test(self): raise TestFailure("FulfillDirectOnlineTest - FAIL: Alice failed to detect payment") if resp["funded"] == False: raise TestFailure("FulfillDirectOnlineTest - FAIL: Alice incorrectly saved as unfunded") - + # alice send order fulfillment - with open('testdata/fulfillment.json') as fulfillment_file: + with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file: fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict) fulfillment_json["orderId"] = orderId fulfillment_json["slug"] = slug diff --git a/qa/listings.py b/qa/listings.py index ecf97313e6..7fece4c8f8 100644 --- a/qa/listings.py +++ b/qa/listings.py @@ -14,7 +14,7 @@ def setup_network(self): def run_test(self): vendor = self.nodes[1] - browser = self.nodes[2] + buyer = self.nodes[2] currency = "tbtc" @@ -33,9 +33,12 @@ def run_test(self): raise TestFailure("ListingsTest - FAIL: Listings GET failed. Reason: %s", resp["reason"]) # POST listing - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: ljson = json.load(listing_file, object_pairs_hook=OrderedDict) - ljson["item"]["priceCurrency"]["code"] = "T" + self.cointype + if self.vendor_version == "v4": + ljson["metadata"]["priceCurrency"] = "t" + self.cointype + else: + ljson["item"]["priceCurrency"]["code"] = "t" + self.cointype ljson["metadata"]["acceptedCurrencies"] = ["t" + self.cointype.lower()] currency = "T" + self.cointype api_url = vendor["gateway_url"] + "ob/listing" @@ -80,7 +83,7 @@ def run_test(self): raise TestFailure("ListingsTest - FAIL: Listing should have acceptedCurrences in metadata") # check vendor's index from another node - api_url = browser["gateway_url"] + "ob/listings/" + vendor["peerId"] + api_url = buyer["gateway_url"] + "ob/listings/" + vendor["peerId"] r = requests.get(api_url) if r.status_code == 404: raise TestFailure("ListingsTest - FAIL: Listings get endpoint not found") diff --git a/qa/manage_crypto_listings.py b/qa/manage_crypto_listings.py index 8b781888bc..e7c125586c 100644 --- a/qa/manage_crypto_listings.py +++ b/qa/manage_crypto_listings.py @@ -15,7 +15,7 @@ def run_test(self): vendor = self.nodes[1] # post profile for vendor - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = vendor["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) @@ -27,7 +27,7 @@ def run_test(self): raise TestFailure("ManageCryptoListingsTest - FAIL: Incorrect listing count: %d", len(resp)) # post listing to vendor - with open('testdata/listing_crypto.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing_crypto.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) listing_json["coinType"] = "TETH" diff --git a/qa/market_price_modifier.py b/qa/market_price_modifier.py index 7ae676e9e0..31c7ff973e 100644 --- a/qa/market_price_modifier.py +++ b/qa/market_price_modifier.py @@ -32,19 +32,23 @@ def run_test(self): time.sleep(20) # post profile for vendor - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = vendor["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listings to vendor - with open('testdata/listing_crypto.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing_crypto.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["metadata"]["coinType"] = "TBCH" - listing_json["metadata"]["coinDivisibility"] = 8 + if self.vendor_version == 5: + listing_json["metadata"]["coinType"] = "TBCH" + listing_json["metadata"]["coinDivisibility"] = 8 listing_json["metadata"]["acceptedCurrencies"] = ["T" + self.cointype] listing_json_with_modifier = deepcopy(listing_json) - listing_json_with_modifier["item"]["priceModifier"] = self.price_modifier + if self.vendor_version == 4: + listing_json_with_modifier["metadata"]["priceModifier"] = self.price_modifier + else: + listing_json_with_modifier["item"]["priceModifier"] = self.price_modifier api_url = vendor["gateway_url"] + "ob/listing" r = requests.post(api_url, data=json.dumps(listing_json, indent=4)) @@ -104,7 +108,7 @@ def run_test(self): raise TestFailure("MarketPriceModifierTest - FAIL: Listing doesn't include priceModifier") # buyer send orders - with open('testdata/order_crypto.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_crypto.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listing_id order_json["paymentCoin"] = "T" + self.cointype @@ -119,7 +123,7 @@ def run_test(self): payment_address = resp["paymentAddress"] payment_amount = int(resp["amount"]["amount"]) - with open('testdata/order_crypto.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_crypto.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listing_id_with_modifier order_json["paymentCoin"] = "T" + self.cointype @@ -132,7 +136,10 @@ def run_test(self): raise TestFailure("MarketPriceModifierTest - FAIL: Purchase POST failed. Reason: %s", resp["reason"]) resp = json.loads(r.text) payment_address_with_modifier = resp["paymentAddress"] - payment_amount_with_modifier = int(resp["amount"]["amount"]) + if self.buyer_version == 4: + payment_address_with_modifier = resp["amount"] + else: + payment_amount_with_modifier = int(resp["amount"]["amount"]) # Check that modified price is different than regular price pct_change = round((payment_amount-payment_amount_with_modifier) / payment_amount * -100, 2) diff --git a/qa/out_of_inventory.py b/qa/out_of_inventory.py index 8753ff3adc..f9a627805b 100644 --- a/qa/out_of_inventory.py +++ b/qa/out_of_inventory.py @@ -16,15 +16,18 @@ def run_test(self): bob = self.nodes[2] # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == 4: + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] listing_json["item"]["skus"][4]["quantity"] = 0 @@ -68,7 +71,7 @@ def run_test(self): time.sleep(10) # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -105,6 +108,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == 4: + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -131,7 +138,7 @@ def run_test(self): self.send_bitcoin_cmd("generate", 1) # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(45) # check alice detected order and payment diff --git a/qa/purchase_crypto_listing.py b/qa/purchase_crypto_listing.py index c50c7a2061..471aa43e5f 100644 --- a/qa/purchase_crypto_listing.py +++ b/qa/purchase_crypto_listing.py @@ -30,13 +30,13 @@ def run_test(self): time.sleep(20) # post profile for vendor - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = vendor["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to vendor - with open('testdata/listing_crypto.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing_crypto.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] @@ -55,7 +55,8 @@ def run_test(self): resp = json.loads(r.text) if r.status_code != 200: raise TestFailure("PurchaseCryptoListingTest - FAIL: Inventory get endpoint failed") - if resp["ether"]["inventory"] != "350000000000000000": + + if int(resp["ether"]["inventory"]) != 350000000000000000: raise TestFailure("PurchaseCryptoListingTest - FAIL: Inventory incorrect: %d", resp["ether"]["inventory"]) # get listing hash @@ -69,7 +70,7 @@ def run_test(self): listingId = resp[0]["hash"] # buyer send order - with open('testdata/order_crypto.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_crypto.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -84,7 +85,12 @@ def run_test(self): orderId = resp["orderId"] payment_address = resp["paymentAddress"] payment_amount = resp["amount"] - if int(payment_amount["amount"]) <= 0: + amt = 0 + if self.buyer_version == "v4": + amt = payment_amount + else: + amt = int(payment_amount["amount"]) + if amt <= 0: raise TestFailure("PurchaseCryptoListingTest - FAIL: Purchase POST failed: paymentAmount is <= 0") # check the purchase saved correctly @@ -127,6 +133,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = buyer["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -163,7 +173,7 @@ def run_test(self): if resp["funded"] == False: raise TestFailure("PurchaseCryptoListingTest - FAIL: Vendor incorrectly saved as unfunded") - with open('testdata/fulfillment_crypto.json') as fulfillment_file: + with open('testdata/'+ self.vendor_version +'/fulfillment_crypto.json') as fulfillment_file: fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict) fulfillment_json["orderId"] = orderId fulfillment_json["slug"] = slug @@ -191,8 +201,13 @@ def run_test(self): resp = json.loads(r.text) if r.status_code != 200: raise TestFailure("PurchaseCryptoListingTest - FAIL: Inventory get endpoint failed") - if resp["ether"]["inventory"] != "340000000000000000": - raise TestFailure("PurchaseCryptoListingTest - FAIL: Inventory incorrect: %d", resp["ether"]["inventory"]) + + if self.buyer_version == "v4": + if int(resp["ether"]["inventory"]) != 340000000000000000: + raise TestFailure("PurchaseCryptoListingTest - FAIL: Inventory incorrect: %d", resp["ether"]["inventory"]) + if self.vendor_version == "v4": + if int(resp["ether"]["inventory"]) != 350000000: + raise TestFailure("PurchaseCryptoListingTest - FAIL: Inventory incorrect: %d", resp["ether"]["inventory"]) print("PurchaseCryptoListingTest - PASS") diff --git a/qa/purchase_digital.py b/qa/purchase_digital.py index b64c9120a4..7925400ea5 100644 --- a/qa/purchase_digital.py +++ b/qa/purchase_digital.py @@ -30,15 +30,18 @@ def run_test(self): time.sleep(20) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/digital.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/digital.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] api_url = alice["gateway_url"] + "ob/listing" @@ -59,7 +62,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_digital.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_digital.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -105,6 +108,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: diff --git a/qa/purchase_direct_offline.py b/qa/purchase_direct_offline.py index 304af4bfc8..4657052076 100644 --- a/qa/purchase_direct_offline.py +++ b/qa/purchase_direct_offline.py @@ -16,16 +16,20 @@ def run_test(self): bob = self.nodes[2] # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] + if self.vendor_version == 4: + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + api_url = alice["gateway_url"] + "ob/listing" r = requests.post(api_url, data=json.dumps(listing_json, indent=4)) @@ -67,7 +71,7 @@ def run_test(self): time.sleep(10) # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -104,6 +108,9 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == 4: + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -130,7 +137,7 @@ def run_test(self): self.send_bitcoin_cmd("generate", 1) # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(60) # check alice detected order and payment diff --git a/qa/purchase_direct_online.py b/qa/purchase_direct_online.py index 3c6da6bc12..550923178f 100644 --- a/qa/purchase_direct_online.py +++ b/qa/purchase_direct_online.py @@ -29,16 +29,19 @@ def run_test(self): time.sleep(20) # post profile for vendor - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = vendor["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to vendor - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] + if self.vendor_version == "v4": + listing_json["metadata"]["pricingCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype api_url = vendor["gateway_url"] + "ob/listing" r = requests.post(api_url, data=json.dumps(listing_json, indent=4)) @@ -59,7 +62,7 @@ def run_test(self): # buyer send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -75,7 +78,6 @@ def run_test(self): payment_address = resp["paymentAddress"] payment_amount = resp["amount"] - # check the purchase saved correctly api_url = buyer["gateway_url"] + "ob/order/" + orderId r = requests.get(api_url) @@ -106,6 +108,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == 4: + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = buyer["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -138,7 +144,7 @@ def run_test(self): raise TestFailure("PurchaseDirectOnlineTest - FAIL: Vendor incorrectly saved as unfunded") # buyer send order - with open('testdata/order_direct_too_much_quantity.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct_too_much_quantity.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId @@ -152,7 +158,7 @@ def run_test(self): raise TestFailure("PurchaseDirectOnlineTest - FAIL: Purchase POST failed with incorrect reason: %s", resp["reason"]) if resp["code"] != "ERR_INSUFFICIENT_INVENTORY": raise TestFailure("PurchaseDirectOnlineTest - FAIL: Purchase POST failed with incorrect code: %s", resp["code"]) - if resp["remainingInventory"] != "6": + if int(resp["remainingInventory"]) != 6: raise TestFailure("PurchaseDirectOnlineTest - FAIL: Purchase POST failed with incorrect remainingInventory: %d", resp["remainingInventory"]) print("PurchaseDirectOnlineTest - PASS") diff --git a/qa/purchase_moderated_offline.py b/qa/purchase_moderated_offline.py index cd25f5aa74..5384848afe 100644 --- a/qa/purchase_moderated_offline.py +++ b/qa/purchase_moderated_offline.py @@ -42,7 +42,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -55,15 +55,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == 4: + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] api_url = alice["gateway_url"] + "ob/listing" @@ -94,7 +97,7 @@ def run_test(self): time.sleep(10) # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -132,6 +135,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == 4: + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -158,7 +165,7 @@ def run_test(self): self.send_bitcoin_cmd("generate", 1) # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(80) # check alice detected order and payment diff --git a/qa/purchase_moderated_online.py b/qa/purchase_moderated_online.py index 14b3d19b37..54426ec389 100644 --- a/qa/purchase_moderated_online.py +++ b/qa/purchase_moderated_online.py @@ -42,7 +42,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -55,15 +55,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] listing_json["moderators"] = [moderatorId] @@ -85,7 +88,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -133,6 +136,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: diff --git a/qa/purchase_offline_error.py b/qa/purchase_offline_error.py index 874b150cb2..c2b31df078 100644 --- a/qa/purchase_offline_error.py +++ b/qa/purchase_offline_error.py @@ -16,15 +16,18 @@ def run_test(self): bob = self.nodes[2] # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == 4: + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] api_url = alice["gateway_url"] + "ob/listing" @@ -67,7 +70,7 @@ def run_test(self): time.sleep(30) # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId @@ -101,7 +104,7 @@ def run_test(self): raise TestFailure("PurchaseOfflineErrorTest - FAIL: Bob incorrectly saved as funded") # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(45) # check alice detected processing error diff --git a/qa/refund_direct.py b/qa/refund_direct.py index 26868c29d0..0e30e7d0b6 100644 --- a/qa/refund_direct.py +++ b/qa/refund_direct.py @@ -44,15 +44,18 @@ def run_test(self): time.sleep(20) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == 4: + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] api_url = alice["gateway_url"] + "ob/listing" @@ -73,7 +76,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -119,6 +122,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == 4: + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -192,8 +199,13 @@ def run_test(self): if r.status_code == 200: resp = json.loads(r.text) confirmed = int(resp["confirmed"]) + amt = 0 + if self.buyer_version == 4: + amt = payment_amount + else: + amt = int(payment_amount["amount"]) #unconfirmed = int(resp["unconfirmed"]) - if confirmed <= 50 - int(payment_amount["amount"]): + if confirmed <= 50 - amt: raise TestFailure("RefundDirectTest - FAIL: Bob failed to receive the multisig payout") else: raise TestFailure("RefundDirectTest - FAIL: Failed to query Bob's balance") diff --git a/qa/refund_moderated.py b/qa/refund_moderated.py index 7fb97f904d..04ecd59a60 100644 --- a/qa/refund_moderated.py +++ b/qa/refund_moderated.py @@ -42,7 +42,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -55,15 +55,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] listing_json["moderators"] = [moderatorId] @@ -85,7 +88,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -133,6 +136,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == 4: + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -211,8 +218,13 @@ def run_test(self): if r.status_code == 200: resp = json.loads(r.text) confirmed = int(resp["confirmed"]) + amt = 0 + if self.buyer_version == 4: + amt = payment_amount + else: + amt = int(payment_amount["amount"]) #unconfirmed = int(resp["unconfirmed"]) - if confirmed <= 50 - int(payment_amount["amount"]): + if confirmed <= 50 - amt: raise TestFailure("RefundModeratedTest - FAIL: Bob failed to receive the multisig payout") else: raise TestFailure("RefundModeratedTest - FAIL: Failed to query Bob's balance") diff --git a/qa/reject_direct_offline.py b/qa/reject_direct_offline.py index f5256b8716..7bc2892c64 100644 --- a/qa/reject_direct_offline.py +++ b/qa/reject_direct_offline.py @@ -30,15 +30,18 @@ def run_test(self): time.sleep(20) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] api_url = alice["gateway_url"] + "ob/listing" @@ -68,7 +71,7 @@ def run_test(self): time.sleep(4) # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -105,6 +108,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -131,7 +138,7 @@ def run_test(self): self.send_bitcoin_cmd("generate", 1) # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(60) # alice reject order @@ -142,10 +149,12 @@ def run_test(self): } r = requests.post(api_url, data=json.dumps(oc, indent=4)) if r.status_code == 404: + print(r.text, r.status_code) raise TestFailure("RejectDirectOfflineTest - FAIL: Order confirmation post endpoint not found") elif r.status_code != 200: resp = json.loads(r.text) raise TestFailure("RejectDirectOfflineTest - FAIL: OrderConfirmation POST failed. Reason: %s", resp["reason"]) + time.sleep(20) # alice check order rejected correctly @@ -179,8 +188,13 @@ def run_test(self): if r.status_code == 200: resp = json.loads(r.text) confirmed = int(resp["confirmed"]) + amt = 0 + if self.buyer_version == 4: + amt = payment_amount + else: + amt = int(payment_amount["amount"]) #unconfirmed = int(resp["unconfirmed"]) - if confirmed <= 50 - int(payment_amount["amount"]): + if confirmed <= 50 - amt: raise TestFailure("RejectDirectOfflineTest - FAIL: Bob failed to receive the multisig payout") else: raise TestFailure("RejectDirectOfflineTest - FAIL: Failed to query Bob's balance") diff --git a/qa/reject_moderated_offline.py b/qa/reject_moderated_offline.py index 8b2648dff5..c2a4a1c949 100644 --- a/qa/reject_moderated_offline.py +++ b/qa/reject_moderated_offline.py @@ -42,7 +42,7 @@ def run_test(self): time.sleep(4) # make charlie a moderator - with open('testdata/moderation.json') as listing_file: + with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file: moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict) api_url = charlie["gateway_url"] + "ob/moderator" r = requests.put(api_url, data=json.dumps(moderation_json, indent=4)) @@ -55,15 +55,18 @@ def run_test(self): time.sleep(4) # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == 4: + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] listing_json["moderators"] = [moderatorId] @@ -94,7 +97,7 @@ def run_test(self): time.sleep(4) # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["moderator"] = moderatorId @@ -132,6 +135,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == 4: + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: @@ -158,7 +165,7 @@ def run_test(self): self.send_bitcoin_cmd("generate", 1) # startup alice again - self.start_node(alice) + self.start_node(1, alice) time.sleep(45) # alice reject order @@ -206,8 +213,13 @@ def run_test(self): if r.status_code == 200: resp = json.loads(r.text) confirmed = int(resp["confirmed"]) + amt = 0 + if self.buyer_version == 4: + amt = payment_amount + else: + amt = int(payment_amount["amount"]) #unconfirmed = int(resp["unconfirmed"]) - if confirmed <= 50 - int(payment_amount["amount"]): + if confirmed <= 50 - amt: raise TestFailure("RejectModeratedOffline - FAIL: Bob failed to receive the multisig payout") else: raise TestFailure("RejectModeratedOffline - FAIL: Failed to query Bob's balance") diff --git a/qa/smtp_notification.py b/qa/smtp_notification.py index 5994337ee8..7024c143fe 100644 --- a/qa/smtp_notification.py +++ b/qa/smtp_notification.py @@ -21,7 +21,7 @@ def run_test(self): bob = self.nodes[2] # post profile for alice - with open('testdata/profile.json') as profile_file: + with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file: profile_json = json.load(profile_file, object_pairs_hook=OrderedDict) api_url = alice["gateway_url"] + "ob/profile" requests.post(api_url, data=json.dumps(profile_json, indent=4)) @@ -77,9 +77,13 @@ def run_test(self): time.sleep(20) # post listing to alice - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] api_url = alice["gateway_url"] + "ob/listing" r = requests.post(api_url, data=json.dumps(listing_json, indent=4)) @@ -99,7 +103,7 @@ def run_test(self): listingId = resp[0]["hash"] # bob send order - with open('testdata/order_direct.json') as order_file: + with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file: order_json = json.load(order_file, object_pairs_hook=OrderedDict) order_json["items"][0]["listingHash"] = listingId order_json["paymentCoin"] = "t" + self.cointype @@ -123,6 +127,10 @@ def run_test(self): "feeLevel": "NORMAL", "requireAssociateOrder": False } + if self.buyer_version == "v4": + spend["amount"] = payment_amount + spend["wallet"] = "T" + self.cointype + api_url = bob["gateway_url"] + "wallet/spend" r = requests.post(api_url, data=json.dumps(spend, indent=4)) if r.status_code == 404: diff --git a/qa/test_framework/test_framework.py b/qa/test_framework/test_framework.py index 347608c071..507fcab2f7 100644 --- a/qa/test_framework/test_framework.py +++ b/qa/test_framework/test_framework.py @@ -41,11 +41,14 @@ class OpenBazaarTestFramework(object): def __init__(self): self.nodes = [] self.bitcoin_api = None + self.vendor_version = "v5" + self.buyer_version = "v5" + self.moderator_version = "v5" def setup_nodes(self): for i in range(self.num_nodes): self.configure_node(i) - self.start_node(self.nodes[i]) + self.start_node(i, self.nodes[i]) def setup_network(self): if self.bitcoind is not None and self.cointype == "BTC": @@ -58,13 +61,28 @@ def run_test(self): def send_bitcoin_cmd(self, *args): try: return self.bitcoin_api.call(*args) + except ConnectionResetError: + self.bitcoin_api = rpc.Proxy(btc_conf_file=self.btc_config) + return self.send_bitcoin_cmd(*args) except BrokenPipeError: self.bitcoin_api = rpc.Proxy(btc_conf_file=self.btc_config) return self.send_bitcoin_cmd(*args) def configure_node(self, n): dir_path = os.path.join(self.temp_dir, "openbazaar-go", str(n)) - args = [self.binary, "init", "-d", dir_path, "--testnet"] + args = [] + + if n == 1 and self.v4vendor_binary: + self.vendor_version = "v4" + args = [self.v4vendor_binary, "init", "-d", dir_path, "--testnet"] + elif n == 2 and self.v4buyer_binary: + self.buyer_version = "v4" + args = [self.v4buyer_binary, "init", "-d", dir_path, "--testnet"] + elif n == 3 and self.v4moderator_binary: + self.moderator_version = "v4" + args = [self.v4moderator_binary, "init", "-d", dir_path, "--testnet"] + else: + args = [self.binary, "init", "-d", dir_path, "--testnet"] if n < 3: args.extend(["-m", BOOTSTAP_MNEMONICS[n]]) process = subprocess.Popen(args, stdout=PIPE) @@ -113,11 +131,22 @@ def wait_for_init_success(process): if "OpenBazaar repo initialized" in str(o): return - def start_node(self, node): - if self.useTor: - args = [self.binary, "start", "--tor", "-v", "-d", node["data_dir"], *self.options] + def start_node(self, n, node): + args = [] + if n == 1 and self.v4vendor_binary is not None: + self.vendor_version = "v4" + args = [self.v4vendor_binary, "start", "-v", "-d", node["data_dir"], *self.options] + elif n == 2 and self.v4buyer_binary is not None: + self.buyer_version = "v4" + args = [self.v4buyer_binary, "start", "-v", "-d", node["data_dir"], *self.options] + elif n == 3 and self.v4moderator_binary is not None: + self.moderator_version = "v4" + args = [self.v4moderator_binary, "start", "-v", "-d", node["data_dir"], *self.options] else: args = [self.binary, "start", "-v", "-d", node["data_dir"], *self.options] + if self.useTor: + args.append("--tor") + process = subprocess.Popen(args, stdout=PIPE) peerId = self.wait_for_start_success(process, node) node["peerId"] = peerId @@ -190,13 +219,19 @@ def main(self, options=["--disablewallet", "--testnet", "--disableexchangerates" description="OpenBazaar Test Framework", usage="python3 test_framework.py [options]" ) - parser.add_argument('-b', '--binary', required=True, help="the openbazaar-go binary") + parser.add_argument('-b', '--binary', help="the openbazaar-go binary") + parser.add_argument('--v4buyer', help="path to a v4 binary if you want to use one") + parser.add_argument('--v4vendor', help="path to a v4 binary if you want to use one") + parser.add_argument('--v4moderator', help="path to a v4 binary if you want to use one") parser.add_argument('-d', '--bitcoind', help="the bitcoind binary") parser.add_argument('-t', '--tempdir', action='store_true', help="temp directory to store the data folders", default="/tmp/") parser.add_argument('-c', '--cointype', help="cointype to test", default="BTC") parser.add_argument('-T', '--tor', help="use tor in QA testing", action='store_true') args = parser.parse_args(sys.argv[1:]) self.binary = args.binary + self.v4buyer_binary = args.v4buyer + self.v4vendor_binary = args.v4vendor + self.v4moderator_binary = args.v4moderator self.temp_dir = args.tempdir self.bitcoind = args.bitcoind self.cointype = args.cointype diff --git a/qa/testdata/v4/completion.json b/qa/testdata/v4/completion.json new file mode 100644 index 0000000000..aee5d5d6f3 --- /dev/null +++ b/qa/testdata/v4/completion.json @@ -0,0 +1,15 @@ +{ + "orderId": "", + "ratings": [ + { + "slug": "", + "overall": 4, + "quality": 5, + "description": 5, + "customerService": 4, + "deliverySpeed": 3, + "review": "I love it!", + "anonymous": true + } + ] +} \ No newline at end of file diff --git a/qa/testdata/v4/digital.json b/qa/testdata/v4/digital.json new file mode 100644 index 0000000000..2b55e948a8 --- /dev/null +++ b/qa/testdata/v4/digital.json @@ -0,0 +1,49 @@ +{ + "slug": "", + "metadata": { + "version": 1, + "contractType": "DIGITAL_GOOD", + "format": "FIXED_PRICE", + "expiry": "2030-08-17T04:52:19.000Z", + "pricingCurrency": "tbtc", + "acceptedCurrencies": ["tbtc", "tbch", "tltc", "tzec"] + }, + "item": { + "title": "Citizenfour", + "description": "A documentarian and a reporter travel to Hong Kong for the first of many meetings with Edward Snowden.", + "processingTime": "1 confirmation", + "price": 12000000, + "tags": [ + "documentary" + ], + "images": [ + { + "tiny": "QmUAuYuiafnJRZxDDX7MuruMNsicYNuyub5vUeAcupUBNs", + "small": "QmXSEqXLCzpCByJU4wqbJ37TcBEj77FKMUWUP1qLh56847", + "medium": "QmYVXrKrKHDC9FobgmcmshCDyWwdrfwfanNQN4oxJ9Fk3h", + "large": "QmUadX5EcvrBmxAV9sE7wUWtWSqxns5K84qKJBixmcT1w9", + "original": "QmfVj3x4D6Jkq9SEoi5n2NmoUomLwoeiwnYz2KQa15wRw6", + "filename": "citizenfour.jpg" + } + ], + "categories": [ + "movies" + ], + "condition": "New", + "skus": [ + ] + }, + "taxes": [ + { + "taxType": "Sales tax", + "taxRegions": [ + "UNITED_STATES" + ], + "taxShipping": false, + "percentage": 7 + } + ], + "moderators": [], + "termsAndConditions": "NA", + "refundPolicy": "No refuns for you. All sales are final." +} \ No newline at end of file diff --git a/qa/testdata/v4/fulfillment.json b/qa/testdata/v4/fulfillment.json new file mode 100644 index 0000000000..d1495f8316 --- /dev/null +++ b/qa/testdata/v4/fulfillment.json @@ -0,0 +1,10 @@ +{ + "orderId": "", + "slug": "", + "physicalDelivery": [ + { + "shipper": "UPS", + "trackingNumber": "1234" + } + ] +} \ No newline at end of file diff --git a/qa/testdata/v4/fulfillment_crypto.json b/qa/testdata/v4/fulfillment_crypto.json new file mode 100644 index 0000000000..b9a34f6193 --- /dev/null +++ b/qa/testdata/v4/fulfillment_crypto.json @@ -0,0 +1,7 @@ +{ + "orderId": "", + "slug": "", + "cryptocurrencyDelivery": [{ + "transactionID": "crypto_transaction_id" + }] +} \ No newline at end of file diff --git a/qa/testdata/v4/listing.json b/qa/testdata/v4/listing.json new file mode 100644 index 0000000000..f1b108c024 --- /dev/null +++ b/qa/testdata/v4/listing.json @@ -0,0 +1,183 @@ +{ + "slug": "", + "metadata": { + "version": 1, + "contractType": "PHYSICAL_GOOD", + "format": "FIXED_PRICE", + "expiry": "2030-08-17T04:52:19.000Z", + "pricingCurrency": "tbtc", + "acceptedCurrencies": ["tbtc", "tbch", "tltc", "tzec"] + }, + "item": { + "title": "Ron Swanson Tshirt", + "description": "Kick ass ron swanson tshirt in yellow", + "processingTime": "1 to 2 Business days", + "price": 12000000, + "tags": [ + "tshirts", + "clothing", + "ron swanson" + ], + "images": [ + { + "tiny": "QmUAuYuiafnJRZxDDX7MuruMNsicYNuyub5vUeAcupUBNs", + "small": "QmXSEqXLCzpCByJU4wqbJ37TcBEj77FKMUWUP1qLh56847", + "medium": "QmYVXrKrKHDC9FobgmcmshCDyWwdrfwfanNQN4oxJ9Fk3h", + "large": "QmUadX5EcvrBmxAV9sE7wUWtWSqxns5K84qKJBixmcT1w9", + "original": "QmfVj3x4D6Jkq9SEoi5n2NmoUomLwoeiwnYz2KQa15wRw6", + "filename": "swanson.jpg" + } + ], + "categories": [ + "clothing" + ], + "grams": 28, + "condition": "New", + "options": [ + { + "name": "Size", + "description": "What size do you want your shirt?", + "variants": [ + { + "name": "Small", + "image": { + "tiny": "QmUAuYuiafnJRZxDDX7MuruMNsicYNuyub5vUeAcupUBNs", + "small": "QmXSEqXLCzpCByJU4wqbJ37TcBEj77FKMUWUP1qLh56847", + "medium": "QmYVXrKrKHDC9FobgmcmshCDyWwdrfwfanNQN4oxJ9Fk3h", + "large": "QmUadX5EcvrBmxAV9sE7wUWtWSqxns5K84qKJBixmcT1w9", + "original": "QmfVj3x4D6Jkq9SEoi5n2NmoUomLwoeiwnYz2KQa15wRw6", + "filename": "swanson.jpg" + } + }, + { + "name": "Medium" + }, + { + "name": "Large" + }, + { + "name": "XL" + } + ] + }, + { + "name": "Color", + "description": "What color do you want your shirt?", + "variants": [ + { + "name": "Red" + }, + { + "name": "Yellow" + } + ] + } + ], + "skus": [ + { + "variantCombo": [0,0], + "productID": "932-33-2945", + "surcharge": 0, + "quantity": 12 + }, + { + "variantCombo": [0,1], + "surcharge": 0, + "quantity": 100 + }, + { + "variantCombo": [1,0], + "productID": "123-99-1111", + "surcharge": 0, + "quantity": 44 + }, + { + "variantCombo": [1,1], + "productID": "229-00-3333", + "surcharge": 0, + "quantity": 19 + }, + { + "variantCombo": [2,0], + "productID": "987-54-3456", + "surcharge": 0, + "quantity": 7 + }, + { + "variantCombo": [2,1], + "surcharge": 0, + "quantity": 3 + }, + { + "variantCombo": [3,0], + "surcharge": 1000, + "quantity": 16 + }, + { + "variantCombo": [3,1], + "surcharge": 1000, + "quantity": 12 + } + ] + }, + "shippingOptions": [ + { + "name": "Domestic Shipping", + "type": "FIXED_PRICE", + "regions": [ + "UNITED_STATES" + ], + "services": [ + { + "name": "Standard", + "price": 6000000, + "estimatedDelivery": "4-6 days" + }, + { + "name": "Express", + "price": 12000000, + "estimatedDelivery": "1-3 days" + } + ] + }, + { + "name": "International Shipping", + "type": "FIXED_PRICE", + "regions": [ + "ALL" + ], + "services": [ + { + "name": "Standard", + "price": 8000000, + "estimatedDelivery": "6-8 days" + }, + { + "name": "Express", + "price": 150000000, + "estimatedDelivery": "2-3 days" + } + ] + } + ], + "taxes": [ + { + "taxType": "Sales tax", + "taxRegions": [ + "UNITED_STATES" + ], + "taxShipping": true, + "percentage": 7 + } + ], + "coupons": [ + { + "title": "10% off", + "discountCode": "radio", + "percentDiscount": 10.0 + } + ], + "moderators": [], + "termsAndConditions": "NA", + "refundPolicy": "No refuns for you. All sales are final." +} \ No newline at end of file diff --git a/qa/testdata/v4/listing_crypto.json b/qa/testdata/v4/listing_crypto.json new file mode 100644 index 0000000000..2e6ae12b6e --- /dev/null +++ b/qa/testdata/v4/listing_crypto.json @@ -0,0 +1,33 @@ +{ + "slug": "", + "metadata": { + "version": 1, + "contractType": "CRYPTOCURRENCY", + "format": "MARKET_PRICE", + "expiry": "2030-08-17T04:52:19.000Z", + "coinType": "ETH", + "coinDivisibility": 100000000 + }, + "item": { + "title": "Ether", + "description": "", + "processingTime": "1 to 2 hours", + "price": 0, + "images": [{ + "tiny": "QmUAuYuiafnJRZxDDX7MuruMNsicYNuyub5vUeAcupUBNs", + "small": "QmXSEqXLCzpCByJU4wqbJ37TcBEj77FKMUWUP1qLh56847", + "medium": "QmYVXrKrKHDC9FobgmcmshCDyWwdrfwfanNQN4oxJ9Fk3h", + "large": "QmUadX5EcvrBmxAV9sE7wUWtWSqxns5K84qKJBixmcT1w9", + "original": "QmfVj3x4D6Jkq9SEoi5n2NmoUomLwoeiwnYz2KQa15wRw6", + "filename": "ether.jpg" + }], + "grams": 0, + "options": [], + "skus": [{ + "quantity": 350000000 + }] + }, + "moderators": [], + "termsAndConditions": "NA", + "refundPolicy": "No refunds for you. All sales are final." +} \ No newline at end of file diff --git a/qa/testdata/v4/moderation.json b/qa/testdata/v4/moderation.json new file mode 100644 index 0000000000..cdb283ecd3 --- /dev/null +++ b/qa/testdata/v4/moderation.json @@ -0,0 +1,9 @@ +{ + "description": "I am a moderator!!!", + "termsAndConditions": "I moderate stuff", + "languages": ["english"], + "fee": { + "feeType": "PERCENTAGE", + "percentage": 10.0 + } +} \ No newline at end of file diff --git a/qa/testdata/v4/order_crypto.json b/qa/testdata/v4/order_crypto.json new file mode 100644 index 0000000000..4b9d2c36bb --- /dev/null +++ b/qa/testdata/v4/order_crypto.json @@ -0,0 +1,10 @@ + +{ + "moderator": "", + "items": [{ + "listingHash": "", + "quantity": 100000000, + "paymentAddress": "crypto_payment_address", + "memo": "thanks!" + }] +} \ No newline at end of file diff --git a/qa/testdata/v4/order_digital.json b/qa/testdata/v4/order_digital.json new file mode 100644 index 0000000000..03da37d4fe --- /dev/null +++ b/qa/testdata/v4/order_digital.json @@ -0,0 +1,10 @@ +{ + "moderator": "", + "items": [ + { + "listingHash": "", + "quantity": 1, + "memo": "thanks!" + } + ] +} \ No newline at end of file diff --git a/qa/testdata/v4/order_direct.json b/qa/testdata/v4/order_direct.json new file mode 100644 index 0000000000..e0580dacdc --- /dev/null +++ b/qa/testdata/v4/order_direct.json @@ -0,0 +1,33 @@ +{ + "shipTo": "Seymour Butts", + "address": "31 Spooner Street", + "city": "Quahog", + "state": "RI", + "postalCode": "00093", + "countryCode": "UNITED_STATES", + "addressNotes": "", + "moderator": "", + "paymentCoin": "", + "items": [ + { + "listingHash": "", + "quantity": 1, + "options": [ + { + "name": "Color", + "value": "Red" + }, + { + "name": "Size", + "value": "Large" + } + ], + "shipping": { + "name": "Domestic Shipping", + "service": "Standard" + }, + "memo": "thanks!", + "coupons": ["discount"] + } + ] +} \ No newline at end of file diff --git a/qa/testdata/v4/order_direct_too_much_quantity.json b/qa/testdata/v4/order_direct_too_much_quantity.json new file mode 100644 index 0000000000..50f41ade34 --- /dev/null +++ b/qa/testdata/v4/order_direct_too_much_quantity.json @@ -0,0 +1,29 @@ +{ + "shipTo": "Satoshi Nakamoto", + "address": "31 Spooner Street", + "city": "Quahog", + "state": "RI", + "postalCode": "00093", + "countryCode": "UNITED_STATES", + "addressNotes": "", + "moderator": "", + "items": [{ + "listingHash": "", + "quantity": 999999999999, + "options": [{ + "name": "Color", + "value": "Red" + }, + { + "name": "Size", + "value": "Large" + } + ], + "shipping": { + "name": "Domestic Shipping", + "service": "Standard" + }, + "memo": "thanks!", + "coupons": ["discount"] + }] +} \ No newline at end of file diff --git a/qa/testdata/profile.json b/qa/testdata/v4/profile.json similarity index 100% rename from qa/testdata/profile.json rename to qa/testdata/v4/profile.json diff --git a/qa/testdata/completion.json b/qa/testdata/v5/completion.json similarity index 100% rename from qa/testdata/completion.json rename to qa/testdata/v5/completion.json diff --git a/qa/testdata/digital.json b/qa/testdata/v5/digital.json similarity index 100% rename from qa/testdata/digital.json rename to qa/testdata/v5/digital.json diff --git a/qa/testdata/eth_digital.json b/qa/testdata/v5/eth_digital.json similarity index 100% rename from qa/testdata/eth_digital.json rename to qa/testdata/v5/eth_digital.json diff --git a/qa/testdata/eth_listing.json b/qa/testdata/v5/eth_listing.json similarity index 100% rename from qa/testdata/eth_listing.json rename to qa/testdata/v5/eth_listing.json diff --git a/qa/testdata/eth_listing_crypto.json b/qa/testdata/v5/eth_listing_crypto.json similarity index 100% rename from qa/testdata/eth_listing_crypto.json rename to qa/testdata/v5/eth_listing_crypto.json diff --git a/qa/testdata/fulfillment.json b/qa/testdata/v5/fulfillment.json similarity index 100% rename from qa/testdata/fulfillment.json rename to qa/testdata/v5/fulfillment.json diff --git a/qa/testdata/fulfillment_crypto.json b/qa/testdata/v5/fulfillment_crypto.json similarity index 100% rename from qa/testdata/fulfillment_crypto.json rename to qa/testdata/v5/fulfillment_crypto.json diff --git a/qa/testdata/listing.json b/qa/testdata/v5/listing.json similarity index 100% rename from qa/testdata/listing.json rename to qa/testdata/v5/listing.json diff --git a/qa/testdata/listing_crypto.json b/qa/testdata/v5/listing_crypto.json similarity index 100% rename from qa/testdata/listing_crypto.json rename to qa/testdata/v5/listing_crypto.json diff --git a/qa/testdata/moderation.json b/qa/testdata/v5/moderation.json similarity index 100% rename from qa/testdata/moderation.json rename to qa/testdata/v5/moderation.json diff --git a/qa/testdata/order_crypto.json b/qa/testdata/v5/order_crypto.json similarity index 77% rename from qa/testdata/order_crypto.json rename to qa/testdata/v5/order_crypto.json index 7d919b6c1c..dba9f51a3b 100644 --- a/qa/testdata/order_crypto.json +++ b/qa/testdata/v5/order_crypto.json @@ -2,8 +2,8 @@ "moderator": "", "items": [{ "listingHash": "", - "bigQuantity": "10000000000000000", + "bigQuantity": "100000000", "paymentAddress": "crypto_payment_address", "memo": "thanks!" }] -} \ No newline at end of file +} diff --git a/qa/testdata/order_digital.json b/qa/testdata/v5/order_digital.json similarity index 100% rename from qa/testdata/order_digital.json rename to qa/testdata/v5/order_digital.json diff --git a/qa/testdata/order_direct.json b/qa/testdata/v5/order_direct.json similarity index 100% rename from qa/testdata/order_direct.json rename to qa/testdata/v5/order_direct.json diff --git a/qa/testdata/order_direct_too_much_quantity.json b/qa/testdata/v5/order_direct_too_much_quantity.json similarity index 100% rename from qa/testdata/order_direct_too_much_quantity.json rename to qa/testdata/v5/order_direct_too_much_quantity.json diff --git a/qa/testdata/v5/profile.json b/qa/testdata/v5/profile.json new file mode 100644 index 0000000000..377243c156 --- /dev/null +++ b/qa/testdata/v5/profile.json @@ -0,0 +1,4 @@ +{ + "name": "alice", + "vendor": true +} \ No newline at end of file diff --git a/qa/upload_listing.py b/qa/upload_listing.py index fd3afe2dfc..5302e3d859 100644 --- a/qa/upload_listing.py +++ b/qa/upload_listing.py @@ -8,31 +8,35 @@ class UploadListingTest(OpenBazaarTestFramework): def __init__(self): super().__init__() - self.num_nodes = 1 + self.num_nodes = 2 def setup_network(self): self.setup_nodes() def run_test(self): - with open('testdata/listing.json') as listing_file: + with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file: listing_json = json.load(listing_file, object_pairs_hook=OrderedDict) - listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype - listing_json["item"]["priceCurrency"]["divisibility"] = 8 - api_url = self.nodes[0]["gateway_url"] + "ob/listing" + if self.vendor_version == "v4": + listing_json["metadata"]["priceCurrency"] = "t" + self.cointype + else: + listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype + listing_json["item"]["priceCurrency"]["divisibility"] = 8 + listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype] + api_url = self.nodes[1]["gateway_url"] + "ob/listing" r = requests.post(api_url, data=json.dumps(listing_json, indent=4)) if r.status_code == 404: raise TestFailure("UploadListingTest - FAIL: Listing post endpoint not found") elif r.status_code != 200: resp = json.loads(r.text) raise TestFailure("UploadListingTest - FAIL: Listing POST failed. Reason: %s", resp["reason"]) - api_url = self.nodes[0]["gateway_url"] + "ob/inventory" + api_url = self.nodes[1]["gateway_url"] + "ob/inventory" r = requests.get(api_url) if r.status_code == 200: resp = json.loads(r.text) inv = resp["ron-swanson-tshirt"] if inv == None: raise TestFailure("UploadListingTest - FAIL: Did not return inventory for listing") - if inv["inventory"] != "213": + if int(inv["inventory"]) != 213: raise TestFailure("UploadListingTest - FAIL: Returned incorrect amount of inventory: %d", inv["inventory"]) elif r.status_code == 404: raise TestFailure("UploadListingTest - FAIL: Listing post endpoint not found") diff --git a/repo/buyer_order.go b/repo/buyer_order.go index 89a7eb4058..70299d8376 100644 --- a/repo/buyer_order.go +++ b/repo/buyer_order.go @@ -8,6 +8,9 @@ import ( // ToV5Order scans through the order looking for any deprecated fields and turns them into their v5 counterpart. func ToV5Order(order *pb.Order, lookupFunc func(currencyCode string) (CurrencyDefinition, error)) (*pb.Order, error) { + if lookupFunc == nil { + lookupFunc = AllCurrencies().Lookup + } newOrder := proto.Clone(order).(*pb.Order) if order.RefundFee != 0 && order.BigRefundFee == "" { diff --git a/repo/db/purchases.go b/repo/db/purchases.go index 064e177693..2f792baf59 100644 --- a/repo/db/purchases.go +++ b/repo/db/purchases.go @@ -4,6 +4,8 @@ import ( "database/sql" "encoding/json" "fmt" + "math/big" + "strings" "sync" "time" @@ -197,6 +199,16 @@ func (p *PurchasesDB) GetAll(stateFilter []pb.OrderState, searchTerm string, sor coinType = "" } + if strings.Contains(totalStr, "e") { + flt, _, err := big.ParseFloat(totalStr, 10, 0, big.ToNearestEven) + if err != nil { + return nil, 0, err + } + var i = new(big.Int) + i, _ = flt.Int(i) + totalStr = i.String() + } + cv, err := repo.NewCurrencyValueWithLookup(totalStr, paymentCoin) if err != nil { return nil, 0, err diff --git a/repo/dispute_case_record.go b/repo/dispute_case_record.go index 4369817750..b68d45c4f9 100644 --- a/repo/dispute_case_record.go +++ b/repo/dispute_case_record.go @@ -107,7 +107,8 @@ func (r *DisputeCaseRecord) ResolutionPaymentFeePerByte(ratio PayoutRatio, defau n := new(big.Int) switch { case ratio.BuyerMajority(), ratio.EvenMajority(): - n, _ = n.SetString(r.BuyerContract.BuyerOrder.BigRefundFee, 10) + v5order, _ := ToV5Order(r.BuyerContract.BuyerOrder, nil) + n, _ = n.SetString(v5order.BigRefundFee, 10) return n case ratio.VendorMajority(): if len(r.VendorContract.VendorOrderFulfillment) > 0 && r.VendorContract.VendorOrderFulfillment[0].Payout != nil { diff --git a/repo/listing.go b/repo/listing.go index dd3a6fcc17..f0dba2666a 100644 --- a/repo/listing.go +++ b/repo/listing.go @@ -919,11 +919,16 @@ func (cs ListingCoupons) GetProtobuf() []*pb.Listing_Coupon { var cspb = make([]*pb.Listing_Coupon, len(cs)) for i, c := range cs { cspb[i] = &pb.Listing_Coupon{ - Title: c.GetTitle(), - PercentDiscount: c.GetPercentOff(), + Title: c.GetTitle(), } - if c.GetAmountOff() != nil { - cspb[i].BigPriceDiscount = c.GetAmountOff().Amount.String() + if c.GetPercentOff() > 0 { + cspb[i].Discount = &pb.Listing_Coupon_PercentDiscount{ + PercentDiscount: c.GetPercentOff(), + } + } else if c.GetAmountOff() != nil { + cspb[i].Discount = &pb.Listing_Coupon_BigPriceDiscount{ + BigPriceDiscount: c.GetAmountOff().Amount.String(), + } } if hash, err := c.GetRedemptionHash(); err == nil { cspb[i].Code = &pb.Listing_Coupon_Hash{Hash: hash} @@ -1488,16 +1493,16 @@ func (l *Listing) ValidateListing(testnet bool) (err error) { if coupon.GetPercentDiscount() > 100 { return errors.New("percent discount cannot be over 100 percent") } - n, ok := new(big.Int).SetString(l.listingProto.Item.BigPrice, 10) - if !ok { - return errors.New("price was invalid") + price, err := l.GetPrice() + if err != nil { + return err } if coupon.GetBigPriceDiscount() != "" { - discount0, ok := new(big.Int).SetString(coupon.BigPriceDiscount, 10) + discount0, ok := new(big.Int).SetString(coupon.GetBigPriceDiscount(), 10) if !ok { return errors.New("coupon discount was invalid") } - if n.Cmp(discount0) < 0 { + if price.Amount.Cmp(discount0) < 0 { return errors.New("price discount cannot be greater than the item price") } } @@ -1545,19 +1550,20 @@ func (l *Listing) ValidateListing(testnet bool) (err error) { // Non-crypto validations if l.listingProto.Metadata.ContractType != pb.Listing_Metadata_CRYPTOCURRENCY { - if l.listingProto.Item.PriceCurrency == nil { + price, err := l.GetPrice() + if err != nil { + return err + } + if price.Currency.Code == "" { return errors.New("pricing currency is missing") } - if priceCurrency, err := AllCurrencies().Lookup(l.listingProto.Item.PriceCurrency.Code); err != nil { + if priceCurrency, err := AllCurrencies().Lookup(price.Currency.Code.String()); err != nil { return errors.New("invalid pricing currency") } else { - if uint(l.listingProto.Item.PriceCurrency.Divisibility) > priceCurrency.Divisibility { + if uint(price.Currency.Divisibility) > priceCurrency.Divisibility { return errors.New("pricing currency divisibility is too large") } } - if _, ok := new(big.Int).SetString(l.listingProto.Item.BigPrice, 10); !ok { - return errors.New("invalid item price amount") - } } // Format-specific validations @@ -1587,7 +1593,11 @@ func (l *Listing) validatePhysicalListing() error { return fmt.Errorf("number of shipping options is greater than the max of %d", MaxListItems) } var shippingTitles []string - for _, shippingOption := range l.listingProto.ShippingOptions { + shippingOptions, err := l.GetShippingOptions() + if err != nil { + return err + } + for _, shippingOption := range shippingOptions { if shippingOption.Name == "" { return errors.New("shipping option title name must not be empty") } diff --git a/repo/notification.go b/repo/notification.go index 17d455fb59..db00615c6f 100644 --- a/repo/notification.go +++ b/repo/notification.go @@ -450,7 +450,7 @@ func (n PaymentNotification) GetID() string { return n.ID } func (n PaymentNotification) GetType() NotificationType { return NotifierTypePaymentNotification } func (n PaymentNotification) GetSMTPTitleAndBody() (string, string, bool) { form := "Payment for order \"%s\" received (total %d)." - return "Payment received", fmt.Sprintf(form, n.OrderId, n.FundingTotal), true + return "Payment received", fmt.Sprintf(form, n.OrderId, n.FundingTotal.Amount), true } type OrderConfirmationNotification struct { diff --git a/repo/signed_listing.go b/repo/signed_listing.go index 9c9c735bc7..4603e38a59 100644 --- a/repo/signed_listing.go +++ b/repo/signed_listing.go @@ -132,7 +132,6 @@ func (l SignedListing) VerifySignature() error { if err != nil { return fmt.Errorf("marshaling listing: %s", err.Error()) } - pubkey, err := l.GetListing().GetVendorID().IdentityKey() if err != nil { return fmt.Errorf("getting identity pubkey: %s", err.Error()) diff --git a/vendor/github.com/OpenBazaar/go-ethwallet/wallet/erc20_wallet.go b/vendor/github.com/OpenBazaar/go-ethwallet/wallet/erc20_wallet.go index a6aff85b06..d842fa7bb2 100644 --- a/vendor/github.com/OpenBazaar/go-ethwallet/wallet/erc20_wallet.go +++ b/vendor/github.com/OpenBazaar/go-ethwallet/wallet/erc20_wallet.go @@ -296,6 +296,9 @@ func (wallet *ERC20Wallet) Transactions() ([]wi.Txn, error) { if t.IsError != 0 { status = wi.StatusError } + if t.Confirmations > 0 && t.Confirmations < 300 { + status = wi.StatusPending + } tnew := wi.Txn{ Txid: t.Hash, Value: t.Value.Int().String(), diff --git a/vendor/github.com/OpenBazaar/go-ethwallet/wallet/wallet.go b/vendor/github.com/OpenBazaar/go-ethwallet/wallet/wallet.go index da75cbf5f9..a95db5d5d3 100644 --- a/vendor/github.com/OpenBazaar/go-ethwallet/wallet/wallet.go +++ b/vendor/github.com/OpenBazaar/go-ethwallet/wallet/wallet.go @@ -519,16 +519,22 @@ func (wallet *EthereumWallet) Balance() (confirmed, unconfirmed wi.CurrencyValue // TransactionsFromBlock - Returns a list of transactions for this wallet begining from the specified block func (wallet *EthereumWallet) TransactionsFromBlock(startBlock *int) ([]wi.Txn, error) { + ret := []wi.Txn{} + + unconf, _ := wallet.db.Txns().GetAll(false) + txns, err := wallet.client.eClient.NormalTxByAddress(util.EnsureCorrectPrefix(wallet.account.Address().String()), startBlock, nil, 1, 0, false) - if err != nil { + if err != nil && len(unconf) == 0 { log.Error("err fetching transactions : ", err) return []wi.Txn{}, nil } - ret := []wi.Txn{} for _, t := range txns { status := wi.StatusConfirmed + if t.Confirmations > 1 && t.Confirmations <= 7 { + status = wi.StatusPending + } prefix := "" if t.IsError != 0 { status = wi.StatusError @@ -549,6 +555,11 @@ func (wallet *EthereumWallet) TransactionsFromBlock(startBlock *int) ([]wi.Txn, ret = append(ret, tnew) } + for _, u := range unconf { + u.Status = wi.StatusUnconfirmed + ret = append(ret, u) + } + return ret, nil } @@ -653,15 +664,20 @@ func (wallet *EthereumWallet) GetFeePerByte(feeLevel wi.FeeLevel) big.Int { // Spend - Send ether to an external wallet func (wallet *EthereumWallet) Spend(amount big.Int, addr btcutil.Address, feeLevel wi.FeeLevel, referenceID string, spendAll bool) (*chainhash.Hash, error) { - var hash common.Hash - var h *chainhash.Hash - var err error + var ( + hash common.Hash + h *chainhash.Hash + watchOnly bool + nonce int32 + err error + ) actualRecipient := addr if referenceID == "" { // no referenceID means this is a direct transfer hash, err = wallet.Transfer(util.EnsureCorrectPrefix(addr.String()), &amount, spendAll, wallet.GetFeePerByte(feeLevel)) } else { + watchOnly = true // this is a spend which means it has to be linked to an order // specified using the referenceID @@ -710,36 +726,36 @@ func (wallet *EthereumWallet) Spend(amount big.Int, addr btcutil.Address, feeLev } // txn is pending - nonce, err := wallet.client.GetTxnNonce(util.EnsureCorrectPrefix(hash.Hex())) - if err == nil { - data, err := SerializePendingTxn(PendingTxn{ - TxnID: hash, - Amount: amount.String(), - OrderID: referenceID, - Nonce: nonce, - From: wallet.address.EncodeAddress(), - To: actualRecipient.EncodeAddress(), - WithInput: false, - }) - if err == nil { - err0 := wallet.db.Txns().Put(data, ut.NormalizeAddress(hash.Hex()), "0", 0, time.Now(), true) - if err0 != nil { - log.Error(err0.Error()) - } - } + nonce, err = wallet.client.GetTxnNonce(util.EnsureCorrectPrefix(hash.Hex())) + if err != nil { + return nil, err } } - if err == nil { h, err = util.CreateChainHash(hash.Hex()) if err == nil { wallet.invokeTxnCB(h.String(), &amount) } } - return h, err + data, err := SerializePendingTxn(PendingTxn{ + TxnID: hash, + Amount: amount.String(), + OrderID: referenceID, + Nonce: nonce, + From: wallet.address.EncodeAddress(), + To: actualRecipient.EncodeAddress(), + WithInput: false, + }) + if err == nil { + err0 := wallet.db.Txns().Put(data, ut.NormalizeAddress(hash.Hex()), amount.String(), 0, time.Now(), watchOnly) + if err0 != nil { + log.Error(err0.Error()) + } + } + return h, nil } -func (wallet *EthereumWallet) createTxnCallback(txID, orderID string, toAddress btcutil.Address, value big.Int, bTime time.Time, withInput bool) wi.TransactionCallback { +func (wallet *EthereumWallet) createTxnCallback(txID, orderID string, toAddress btcutil.Address, value big.Int, bTime time.Time, withInput bool, height int64) wi.TransactionCallback { output := wi.TransactionOutput{ Address: toAddress, Value: value, @@ -759,12 +775,11 @@ func (wallet *EthereumWallet) createTxnCallback(txID, orderID string, toAddress } } - return wi.TransactionCallback{ Txid: util.EnsureCorrectPrefix(txID), Outputs: []wi.TransactionOutput{output}, Inputs: []wi.TransactionInput{input}, - Height: 1, + Height: int32(height), Timestamp: time.Now(), Value: value, WatchOnly: false, @@ -812,9 +827,10 @@ func (wallet *EthereumWallet) checkTxnRcpt(hash *common.Hash, data []byte) (*com toAddr = common.HexToAddress(util.EnsureCorrectPrefix(pTxn.To)) withInput = pTxn.WithInput } + height := rcpt.BlockNumber.Int64() go wallet.AssociateTransactionWithOrder( wallet.createTxnCallback(util.EnsureCorrectPrefix(hash.Hex()), pTxn.OrderID, EthAddress{&toAddr}, - *n, time.Now(), withInput)) + *n, time.Now(), withInput, height)) } } return hash, nil @@ -1448,14 +1464,23 @@ func (wallet *EthereumWallet) GetConfirmations(txid chainhash.Hash) (confirms, a result := s["result"].(map[string]interface{}) - d, _ := strconv.ParseInt(result["blockNumber"].(string), 0, 64) + var d, conf int64 + if result["blockNumber"] != nil { + d, _ = strconv.ParseInt(result["blockNumber"].(string), 0, 64) + } else { + d = 0 + } n, err := wallet.client.HeaderByNumber(context.Background(), nil) if err != nil { return 0, 0, err } - conf := n.Number.Int64() - d + if d != 0 { + conf = n.Number.Int64() - d + 1 + } else { + conf = 0 + } return uint32(conf), uint32(d), nil } diff --git a/wallet/listeners/transaction_listener.go b/wallet/listeners/transaction_listener.go index 3cda723a69..86a3dbd7b9 100644 --- a/wallet/listeners/transaction_listener.go +++ b/wallet/listeners/transaction_listener.go @@ -129,7 +129,7 @@ func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallbac log.Errorf("update funding for sale (%s): %s", orderId, err) } // This is a dispute payout. We should set the order state. - if state == pb.OrderState_DECIDED && len(records) > 0 && fundsReleased { + if len(records) > 0 && fundsReleased { if contract.DisputeAcceptance == nil && contract != nil && contract.BuyerOrder != nil && contract.BuyerOrder.BuyerID != nil { accept := new(pb.DisputeAcceptance) ts, _ := ptypes.TimestampProto(time.Now()) @@ -154,8 +154,14 @@ func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallbac log.Errorf("persist dispute acceptance notification for order (%s): %s", orderId, err) } } - if err := l.db.Sales().Put(orderId, *contract, pb.OrderState_RESOLVED, false); err != nil { - log.Errorf("failed updating order (%s) to RESOLVED: %s", orderId, err.Error()) + if state == pb.OrderState_DECIDED { + if err := l.db.Sales().Put(orderId, *contract, pb.OrderState_RESOLVED, false); err != nil { + log.Errorf("failed updating order (%s) to RESOLVED: %s", orderId, err.Error()) + } + } else { + if err := l.db.Sales().Put(orderId, *contract, state, false); err != nil { + log.Errorf("failed updating order (%s) with DisputeAcceptance: %s", orderId, err.Error()) + } } } } else { @@ -163,7 +169,7 @@ func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallbac if err != nil { log.Errorf("update funding for purchase (%s): %s", orderId, err) } - if state == pb.OrderState_DECIDED && len(records) > 0 && fundsReleased { + if len(records) > 0 && fundsReleased { if contract.DisputeAcceptance == nil && contract != nil && len(contract.VendorListings) > 0 && contract.VendorListings[0].VendorID != nil { accept := new(pb.DisputeAcceptance) ts, _ := ptypes.TimestampProto(time.Now()) @@ -192,8 +198,14 @@ func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallbac log.Errorf("persist dispute acceptance notification for order (%s): %s", orderId, err) } } - if err := l.db.Purchases().Put(orderId, *contract, pb.OrderState_RESOLVED, false); err != nil { - log.Errorf("failed updating order (%s) to RESOLVED: %s", orderId, err.Error()) + if state == pb.OrderState_DECIDED { + if err := l.db.Purchases().Put(orderId, *contract, pb.OrderState_RESOLVED, false); err != nil { + log.Errorf("failed updating order (%s) to RESOLVED: %s", orderId, err.Error()) + } + } else { + if err := l.db.Purchases().Put(orderId, *contract, state, false); err != nil { + log.Errorf("failed updating order (%s) with DisputeAcceptance: %s", orderId, err.Error()) + } } } } @@ -213,12 +225,17 @@ func (l *TransactionListener) processSalePayment(txid string, output wallet.Tran if err != nil { return } + order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + log.Error(err) + return + } if !funded { - currencyValue, err := repo.NewCurrencyValueWithLookup(contract.BuyerOrder.Payment.BigAmount, contract.BuyerOrder.Payment.AmountCurrency.Code) + currencyValue, err := repo.NewCurrencyValueWithLookup(order.Payment.BigAmount, order.Payment.AmountCurrency.Code) if err != nil { log.Errorf("Failed parsing CurrencyValue for (%s, %s): %s", - contract.BuyerOrder.Payment.BigAmount, - contract.BuyerOrder.Payment.AmountCurrency.Code, + order.Payment.BigAmount, + order.Payment.AmountCurrency.Code, err.Error(), ) return @@ -310,8 +327,13 @@ func (l *TransactionListener) processPurchasePayment(txid string, output wallet. if err != nil { return } + order, err := repo.ToV5Order(contract.BuyerOrder, nil) + if err != nil { + log.Error(err) + return + } if !funded { - requestedAmount, _ := new(big.Int).SetString(contract.BuyerOrder.Payment.BigAmount, 10) + requestedAmount, _ := new(big.Int).SetString(order.Payment.BigAmount, 10) if funding.Cmp(requestedAmount) >= 0 { log.Debugf("Payment for purchase %s detected", orderId) funded = true @@ -325,7 +347,7 @@ func (l *TransactionListener) processPurchasePayment(txid string, output wallet. } } } - def, err := repo.AllCurrencies().Lookup(contract.BuyerOrder.Payment.AmountCurrency.Code) + def, err := repo.AllCurrencies().Lookup(order.Payment.AmountCurrency.Code) if err != nil { log.Errorf("Error looking up currency: %s", err) return @@ -340,7 +362,7 @@ func (l *TransactionListener) processPurchasePayment(txid string, output wallet. Type: "payment", OrderId: orderId, FundingTotal: cv, - CoinType: contract.BuyerOrder.Payment.AmountCurrency.Code, + CoinType: order.Payment.AmountCurrency.Code, } l.broadcast <- n err = l.db.Notifications().PutRecord(repo.NewNotification(n, time.Now(), false))