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

Commit 07d0034

Browse files
committed
Review fixup
1 parent 79f145b commit 07d0034

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

repo/db/cases.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,7 @@ func (c *CasesDB) GetAll(stateFilter []pb.OrderState, searchTerm string, sortByA
287287
}
288288
}
289289

290-
cur, err := repo.AllCurrencies().Lookup(paymentCoin)
291-
if err != nil {
292-
return nil, 0, err
293-
}
294-
cv, err := repo.NewCurrencyValue(total.String(), cur)
290+
cv, err := repo.NewCurrencyValueWithLookup(total.String(), paymentCoin)
295291
if err != nil {
296292
return nil, 0, err
297293
}

repo/db/purchases.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,7 @@ func (p *PurchasesDB) GetAll(stateFilter []pb.OrderState, searchTerm string, sor
197197
coinType = ""
198198
}
199199

200-
cur, err := repo.AllCurrencies().Lookup(paymentCoin)
201-
if err != nil {
202-
return nil, 0, err
203-
}
204-
cv, err := repo.NewCurrencyValue(totalStr, cur)
200+
cv, err := repo.NewCurrencyValueWithLookup(totalStr, paymentCoin)
205201
if err != nil {
206202
return nil, 0, err
207203
}

repo/db/sales.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,7 @@ func (s *SalesDB) GetAll(stateFilter []pb.OrderState, searchTerm string, sortByA
198198
coinType = ""
199199
}
200200

201-
cur, err := repo.AllCurrencies().Lookup(paymentCoin)
202-
if err != nil {
203-
return nil, 0, err
204-
}
205-
cv, err := repo.NewCurrencyValue(totalStr, cur)
201+
cv, err := repo.NewCurrencyValueWithLookup(totalStr, paymentCoin)
206202
if err != nil {
207203
return nil, 0, err
208204
}

repo/db/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func PaymentCoinForContract(contract *pb.RicardianContract) (string, error) {
1616
if len(contract.VendorListings[0].Metadata.AcceptedCurrencies) > 0 {
1717
return contract.VendorListings[0].Metadata.AcceptedCurrencies[0], nil
1818
}
19-
return "", errors.New("payment coin not foun")
19+
return "", errors.New("payment coin not found")
2020
}
2121

2222
func CoinTypeForContract(contract *pb.RicardianContract) string {

0 commit comments

Comments
 (0)