[fix] Fix C-compilation error failing tests

This commit is contained in:
Eric Mastro
2022-08-26 13:29:09 +10:00
committed by Eric Mastro
parent 01419d3fc3
commit 58f3335cc1
+3 -1
View File
@@ -32,7 +32,9 @@ proc start(purchase: Purchase) {.gcsafe.}
func id*(purchase: Purchase): PurchaseId
proc `==`*(x, y: PurchaseId): bool {.borrow.}
proc hash*(x: PurchaseId): Hash {.borrow.}
proc toHex*(x: PurchaseId): string {.borrow.}
# Using {.borrow.} for toHex does not borrow correctly and causes a
# C-compilation error, so we must do it long form
proc toHex*(x: PurchaseId): string = array[32, byte](x).toHex
proc new*(_: type Purchasing, market: Market, clock: Clock): Purchasing =
Purchasing(