Fixes for Nim 1.2.x
This commit is contained in:
parent
ad3d2f7a4b
commit
2a8133b349
|
@ -23,4 +23,5 @@ func toArray*(address: Address): array[20, byte] =
|
|||
func `$`*(address: Address): string =
|
||||
"0x" & toHex(address.toArray)
|
||||
|
||||
func `==`*(a, b: Address): bool {.borrow.}
|
||||
func `==`*(a, b: Address): bool =
|
||||
a.toArray == b.toArray
|
||||
|
|
|
@ -34,17 +34,17 @@ solidityType bool, "bool"
|
|||
solidityType string, "string"
|
||||
solidityType Address, "address"
|
||||
|
||||
func solidityType*[N: static int](_: type array[N, byte]): string =
|
||||
"bytes" & $N
|
||||
|
||||
func solidityType*(_: type seq[byte]): string =
|
||||
"bytes"
|
||||
|
||||
func solidityType*[T, N](_: type array[N, T]): string =
|
||||
solidityType(T) & "[" & $array[N, T].default.len & "]"
|
||||
func solidityType*[N: static int, T](_: type array[N, T]): string =
|
||||
when T is byte:
|
||||
"bytes" & $N
|
||||
else:
|
||||
solidityType(T) & "[" & $N & "]"
|
||||
|
||||
func solidityType*[T](_: type seq[T]): string =
|
||||
solidityType(T) & "[]"
|
||||
when T is byte:
|
||||
"bytes"
|
||||
else:
|
||||
solidityType(T) & "[]"
|
||||
|
||||
func solidityType*(Tuple: type tuple): string =
|
||||
var names: seq[string]
|
||||
|
|
Loading…
Reference in New Issue