nim-eth/eth/rlp/options.nim
Kim De Mey 762415319c
Add build_dcli target and add it to CI (#344)
* Add build_dcli target and add it to CI

* Fix local imports for dcli

* And use local imports for all other files too

* Use local imports in tests and rlpx protocols
2021-04-06 13:33:24 +02:00

18 lines
314 B
Nim

import
std/options,
../rlp
proc read*[T](rlp: var Rlp, O: type Option[T]): O {.inline.} =
mixin read
if not rlp.isEmpty:
result = some read(rlp, T)
proc append*(writer: var RlpWriter, value: Option) =
if value.isSome:
writer.append value.get
else:
writer.append ""
export
options, rlp