Fixed seq[byte] and seq[char] serialization

This commit is contained in:
Yuriy Glukhov 2018-05-15 16:06:06 +03:00 committed by zah
parent 37b3803fcf
commit 6dddfdf675
2 changed files with 1 additions and 8 deletions

View File

@ -186,13 +186,6 @@ proc append*[T](self; listOrBlob: openarray[T]) =
for i in 0 ..< listOrBlob.len: for i in 0 ..< listOrBlob.len:
self.append listOrBlob[i] self.append listOrBlob[i]
proc append*[T](self; list: seq[T]) =
mixin append
self.startList list.len
for i in 0 ..< list.len:
self.append list[i]
proc append*(self; data: object|tuple, wrapInList = wrapObjectsInList) = proc append*(self; data: object|tuple, wrapInList = wrapObjectsInList) =
# TODO: This append proc should be overloaded by `BytesRange` after # TODO: This append proc should be overloaded by `BytesRange` after
# nim bug #7416 is fixed. # nim bug #7416 is fixed.

View File

@ -111,7 +111,7 @@ test "malformed/truncated RLP":
test "encode byte arrays": test "encode byte arrays":
var b1 = [byte(1), 2, 5, 7, 8] var b1 = [byte(1), 2, 5, 7, 8]
var b2 = [byte(6), 8, 12, 123] var b2 = [byte(6), 8, 12, 123]
var b3 = [byte(122), 56, 65, 12] var b3 = @[byte(122), 56, 65, 12]
let rlp = rlpFromBytes(encode((b1, b2, b3))) let rlp = rlpFromBytes(encode((b1, b2, b3)))
check: check: