mirror of
https://github.com/status-im/nim-dagger.git
synced 2025-01-31 00:46:47 +00:00
407f77871f
* chore: warning cleanup * chore: fix proper disabling of warning * chore: ignore the import when not needed
12 lines
365 B
Nim
12 lines
365 B
Nim
import std/hashes
|
|
import ../logutils
|
|
|
|
type PurchaseId* = distinct array[32, byte]
|
|
|
|
logutils.formatIt(LogFormat.textLines, PurchaseId): it.short0xHexLog
|
|
logutils.formatIt(LogFormat.json, PurchaseId): it.to0xHexLog
|
|
|
|
proc hash*(x: PurchaseId): Hash {.borrow.}
|
|
proc `==`*(x, y: PurchaseId): bool {.borrow.}
|
|
proc toHex*(x: PurchaseId): string = array[32, byte](x).toHex
|