From 7dd92327ded4a3be01219bd8bd9c8018c2b10c78 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 25 Sep 2018 15:39:42 +0300 Subject: [PATCH] use Bytes instead of seq[byte] --- rlp/writer.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rlp/writer.nim b/rlp/writer.nim index 6e5c0d8..bb08e4e 100644 --- a/rlp/writer.nim +++ b/rlp/writer.nim @@ -245,24 +245,24 @@ proc initRlpList*(listSize: int): RlpWriter = startList(result, listSize) # TODO: This should return a lent value -proc finish*(self): seq[byte] = +proc finish*(self): Bytes = if pendingLists.len > 0: raise newException(PrematureFinalizationError, "Insufficient number of elements written to a started list") result = output -proc encode*[T](v: T): seq[byte] = +proc encode*[T](v: T): Bytes = mixin append var writer = initRlpWriter() writer.append(v) return writer.finish -proc encodeInt*(i: Integer): seq[byte] = +proc encodeInt*(i: Integer): Bytes = var writer = initRlpWriter() writer.appendInt(i) return writer.finish -macro encodeList*(args: varargs[untyped]): seq[byte] = +macro encodeList*(args: varargs[untyped]): Bytes = var listLen = args.len writer = genSym(nskVar, "rlpWriter")