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

Commit aa650c7

Browse files
committed
[#1976] GET /ob/order/... normalizes legacy listing contract data
1 parent 7ba336a commit aa650c7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

core/order.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ func (n *OpenBazaarNode) GetOrder(orderID string) (*pb.OrderRespApi, error) {
6161
}
6262
isSale = true
6363
}
64+
65+
for i, l := range contract.VendorListings {
66+
repoListing, err := repo.NewListingFromProtobuf(l)
67+
if err != nil {
68+
log.Errorf("failed getting contract listing: %s", err.Error())
69+
return nil, err
70+
}
71+
normalizedListing, err := repoListing.Normalize()
72+
if err != nil {
73+
log.Errorf("failed converting contract listing to v5 schema: %s", err.Error())
74+
return nil, err
75+
}
76+
contract.VendorListings[i] = normalizedListing.GetProtobuf()
77+
}
78+
6479
resp := new(pb.OrderRespApi)
6580
resp.Contract = contract
6681
resp.Funded = funded

0 commit comments

Comments
 (0)