Get rid of some remaining references to rlp.PrematureFinalizationError

This commit is contained in:
Zahary Karadjov 2020-02-05 14:58:07 +01:00 committed by zah
parent 7e836a2c96
commit 9364a2640a
2 changed files with 3 additions and 4 deletions

View File

@ -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
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`
before writing a sufficient number of elements will then result in a
`PrematureFinalizationError`.
before writing the sufficient number of elements will then result in an assertion failure.
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

View File

@ -30,7 +30,7 @@ test "you cannot finish a list without appending enough elements":
writer.append "foo"
writer.append "bar"
expect PrematureFinalizationError:
expect Defect:
let result = writer.finish
proc withNewLines(x: string): string = x & "\n"