[fix] Fix C-compilation error failing tests

This commit is contained in:
Eric Mastro 2022-08-22 12:55:19 +10:00 committed by Eric Mastro
parent 01419d3fc3
commit 58f3335cc1
1 changed files with 3 additions and 1 deletions

View File

@ -32,7 +32,9 @@ proc start(purchase: Purchase) {.gcsafe.}
func id*(purchase: Purchase): PurchaseId func id*(purchase: Purchase): PurchaseId
proc `==`*(x, y: PurchaseId): bool {.borrow.} proc `==`*(x, y: PurchaseId): bool {.borrow.}
proc hash*(x: PurchaseId): Hash {.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 = proc new*(_: type Purchasing, market: Market, clock: Clock): Purchasing =
Purchasing( Purchasing(