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

Commit 21006b4

Browse files
committed
Fix currency value in order notification
1 parent 1c9222c commit 21006b4

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

repo/listing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,8 @@ func (cs ListingCoupons) GetProtobuf() []*pb.Listing_Coupon {
919919
var cspb = make([]*pb.Listing_Coupon, len(cs))
920920
for i, c := range cs {
921921
cspb[i] = &pb.Listing_Coupon{
922-
Title: c.GetTitle(),
923-
PercentDiscount: c.GetPercentOff(),
922+
Title: c.GetTitle(),
923+
PercentDiscount: c.GetPercentOff(),
924924
}
925925
if c.GetAmountOff() != nil {
926926
cspb[i].BigPriceDiscount = c.GetAmountOff().Amount.String()

wallet/listeners/transaction_listener.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,6 @@ func (l *TransactionListener) processSalePayment(txid string, output wallet.Tran
225225
return
226226
}
227227

228-
// update divisibility from contract listing
229-
if contract.VendorListings[0].Metadata.ContractType != pb.Listing_Metadata_CRYPTOCURRENCY {
230-
customDivisibility := currencyDivisibilityFromContract(l.multiwallet, contract)
231-
if customDivisibility != currencyValue.Currency.Divisibility {
232-
currencyValue.Currency.Divisibility = customDivisibility
233-
if err := currencyValue.Valid(); err != nil {
234-
log.Errorf("Invalid currency divisibility (%d) found in contract (%s): %s", customDivisibility, orderId, err.Error())
235-
return
236-
}
237-
}
238-
}
239-
240-
// TODO: this comparison needs to consider the possibility of different divisibilities
241228
if funding.Cmp(currencyValue.Amount) >= 0 {
242229
log.Debugf("Received payment for order %s", orderId)
243230
funded = true

0 commit comments

Comments
 (0)