From 9364a2640aa1e7d1f6fb5ab074489a6a034afb5a Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 5 Feb 2020 14:58:07 +0100 Subject: [PATCH] Get rid of some remaining references to rlp.PrematureFinalizationError --- doc/rlp.md | 5 ++--- tests/rlp/test_api_usage.nim | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/rlp.md b/doc/rlp.md index 346e1c9..aa4ca28 100644 --- a/doc/rlp.md +++ b/doc/rlp.md @@ -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 diff --git a/tests/rlp/test_api_usage.nim b/tests/rlp/test_api_usage.nim index ef08dbc..aae27ad 100644 --- a/tests/rlp/test_api_usage.nim +++ b/tests/rlp/test_api_usage.nim @@ -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"