Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit c761b23

Browse files
committed
Merge branch 'ethereum-master' into eth_fees
2 parents 40f5ac4 + edf5d5d commit c761b23

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

core/order.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ func (n *OpenBazaarNode) Purchase(data *repo.PurchaseData) (orderID string, paym
162162
return "", "", retCurrency, false, err
163163
}
164164

165+
if wal.IsDust(*total) {
166+
return "", "", retCurrency, false, ErrSpendAmountIsDust
167+
}
168+
165169
payment.BigAmount = total.String()
166170

167171
contract, err = n.SignOrder(contract)

repo/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/tyler-smith/go-bip39"
1818
)
1919

20-
const RepoVersion = "32"
20+
const RepoVersion = "34"
2121

2222
var log = logging.MustGetLogger("repo")
2323
var ErrRepoExists = errors.New("IPFS configuration file exists. Reinitializing would overwrite your keys. Use -f to force overwrite.")

repo/migration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var (
5353
migrations.Migration030{},
5454
migrations.Migration031{},
5555
migrations.Migration032{},
56+
migrations.Migration033{},
5657
}
5758
)
5859

repo/notification.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ type PaymentNotification struct {
436436
ID string `json:"notificationId"`
437437
Type NotificationType `json:"type"`
438438
OrderId string `json:"orderId"`
439-
FundingTotal string `json:"fundingTotal"`
439+
FundingTotal *CurrencyValue `json:"fundingTotal"`
440440
CoinType string `json:"coinType"`
441441
}
442442

wallet/listeners/transaction_listener.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,21 @@ func (l *TransactionListener) processPurchasePayment(txid string, output wallet.
351351
}
352352
}
353353
}
354+
def, err := repo.AllCurrencies().Lookup(contract.BuyerOrder.Payment.AmountCurrency.Code)
355+
if err != nil {
356+
log.Errorf("Error looking up currency: %s", err)
357+
return
358+
}
359+
cv, err := repo.NewCurrencyValue(funding.String(), def)
360+
if err != nil {
361+
log.Errorf("Error creating currency value: %s", err)
362+
return
363+
}
354364
n := repo.PaymentNotification{
355365
ID: repo.NewNotificationID(),
356366
Type: "payment",
357367
OrderId: orderId,
358-
FundingTotal: funding.String(),
368+
FundingTotal: cv,
359369
CoinType: contract.BuyerOrder.Payment.AmountCurrency.Code,
360370
}
361371
l.broadcast <- n

0 commit comments

Comments
 (0)