Fix compilation errors with Nim 1.2.6

This commit is contained in:
Mark Spanbroek 2021-03-17 15:34:55 +01:00
parent ea3c3bf34d
commit cbc69a69e6
3 changed files with 5 additions and 5 deletions

View File

@ -17,8 +17,8 @@ func `$`*(destination: Destination): string =
func parse*(_: type Destination, s: string): ?Destination = func parse*(_: type Destination, s: string): ?Destination =
Destination(array[32, byte].fromHex(s)).catch.option Destination(array[32, byte].fromHex(s)).catch.option
func `==`*(a, b: Destination): bool {.borrow.} proc `==`*(a, b: Destination): bool {.borrow.}
func hash*(destination: Destination): Hash {.borrow.} proc hash*(destination: Destination): Hash {.borrow.}
func toDestination*(address: EthAddress): Destination = func toDestination*(address: EthAddress): Destination =
var bytes: array[32, byte] var bytes: array[32, byte]

View File

@ -18,4 +18,4 @@ func `$`*(a: EthAddress): string =
func parse*(_: type EthAddress, hex: string): ?EthAddress = func parse*(_: type EthAddress, hex: string): ?EthAddress =
EthAddress(array[20, byte].fromHex(hex)).catch.option EthAddress(array[20, byte].fromHex(hex)).catch.option
func `==`*(a, b: EthAddress): bool {.borrow.} proc `==`*(a, b: EthAddress): bool {.borrow.}

View File

@ -36,7 +36,7 @@ func init*(_: type Outcome,
) )
Outcome(@[assetOutcome]) Outcome(@[assetOutcome])
func `==`*(a, b: Allocation): bool {.borrow.} proc `==`*(a, b: Allocation): bool {.borrow.}
func `==`*(a, b: AssetOutcome): bool = func `==`*(a, b: AssetOutcome): bool =
if a.kind != b.kind: if a.kind != b.kind:
@ -49,7 +49,7 @@ func `==`*(a, b: AssetOutcome): bool =
of guaranteeType: of guaranteeType:
a.guarantee == b.guarantee a.guarantee == b.guarantee
func `==`*(a, b: Outcome): bool {.borrow.} proc `==`*(a, b: Outcome): bool {.borrow.}
func encode*(encoder: var AbiEncoder, guarantee: Guarantee) = func encode*(encoder: var AbiEncoder, guarantee: Guarantee) =
encoder.startTuple() encoder.startTuple()