mirror of https://github.com/status-im/nim-eth.git
Get rid of some remaining references to rlp.PrematureFinalizationError
This commit is contained in:
parent
7e836a2c96
commit
9364a2640a
|
@ -88,10 +88,9 @@ with the `initRlpWriter` proc. This should be followed by one or more calls
|
||||||
to `append` which is overloaded to accept arbitrary values. Finally, you can
|
to `append` which is overloaded to accept arbitrary values. Finally, you can
|
||||||
call `finish` to obtain the final `BytesRange`.
|
call `finish` to obtain the final `BytesRange`.
|
||||||
|
|
||||||
If the end result should by a RLP list of particular length, you can replace
|
If the end result should be a RLP list of particular length, you can replace
|
||||||
the initial call to `initRlpWriter` with `initRlpList(n)`. Calling `finish`
|
the initial call to `initRlpWriter` with `initRlpList(n)`. Calling `finish`
|
||||||
before writing a sufficient number of elements will then result in a
|
before writing the sufficient number of elements will then result in an assertion failure.
|
||||||
`PrematureFinalizationError`.
|
|
||||||
|
|
||||||
As an alternative short-cut, you can also call `encode` on an arbitrary value
|
As an alternative short-cut, you can also call `encode` on an arbitrary value
|
||||||
(including sequences and user-defined types) to execute all of the steps at
|
(including sequences and user-defined types) to execute all of the steps at
|
||||||
|
|
|
@ -30,7 +30,7 @@ test "you cannot finish a list without appending enough elements":
|
||||||
writer.append "foo"
|
writer.append "foo"
|
||||||
writer.append "bar"
|
writer.append "bar"
|
||||||
|
|
||||||
expect PrematureFinalizationError:
|
expect Defect:
|
||||||
let result = writer.finish
|
let result = writer.finish
|
||||||
|
|
||||||
proc withNewLines(x: string): string = x & "\n"
|
proc withNewLines(x: string): string = x & "\n"
|
||||||
|
|
Loading…
Reference in New Issue