support for encoding and decoding of bool values

This commit is contained in:
Zahary Karadjov 2018-07-22 14:19:24 +03:00
parent 3b2ce4e464
commit 961cc48b11
2 changed files with 7 additions and 0 deletions

View File

@ -293,6 +293,10 @@ proc readImpl(rlp: var Rlp, T: typedesc[enum]): T =
result = type(result)(rlp.toInt(int))
rlp.skipElem
proc readImpl(rlp: var Rlp, T: typedesc[bool]): T =
result = rlp.toInt(int) != 0
rlp.skipElem
proc readImpl[R, E](rlp: var Rlp, T: type array[R, E]): T =
mixin read

View File

@ -191,6 +191,9 @@ template appendImpl(self; i: Integer) =
template appendImpl(self; e: enum) =
appendImpl(self, int(e))
template appendImpl(self; b: bool) =
appendImpl(self, int(b))
proc appendImpl[T](self; listOrBlob: openarray[T]) =
mixin append