librlp

C library for the Recursive Length Prefix (RLP) serialization format
git clone git://git.defalsify.org/librlp.git
Log | Files | Refs | LICENSE

commit acd17b34f02dc448454f2562b04205f6c94c5290
parent 90a947df7ac457102954e8cf3419f620849d8a5a
Author: nolash <dev@holbrook.no>
Date:   Sat, 10 Apr 2021 15:34:08 +0200

Add pdf snapshot of wiki page

Diffstat:
Adoc/rlp_ethereum_wiki_20210410153320.pdf | 0
Mtests/check_vector.c | 4++++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/doc/rlp_ethereum_wiki_20210410153320.pdf b/doc/rlp_ethereum_wiki_20210410153320.pdf Binary files differ. diff --git a/tests/check_vector.c b/tests/check_vector.c @@ -12,6 +12,7 @@ START_TEST(rlp_dog_test) { char r_dog[4] = {0x83, 'd', 'o', 'g'}; rlp_add(&encoder, 3, x_dog); ck_assert_mem_eq(encoder.buf, r_dog, 4); + ck_assert_int_eq(rlp_length(&encoder), 4); rlp_free(&encoder); } @@ -30,6 +31,7 @@ START_TEST(rlp_catdog_test) { rlp_add(&encoder, 3, x_dog); rlp_ascend(&encoder); ck_assert_mem_eq(encoder.buf, r_catdog, 9); + ck_assert_int_eq(rlp_length(&encoder), 9); rlp_free(&encoder); } @@ -46,6 +48,7 @@ START_TEST(rlp_lorem_test) { rlp_add(&encoder, strlen(lorem), lorem); ck_assert_mem_eq(encoder.buf, target, 2); ck_assert_mem_eq(encoder.buf+2, lorem, strlen(lorem)); + ck_assert_int_eq(rlp_length(&encoder), 2 + strlen(lorem)); rlp_free(&encoder); } @@ -82,6 +85,7 @@ START_TEST(rlp_set_theoretical_representation_of_three) { rlp_ascend(&encoder); ck_assert_mem_eq(encoder.buf, target, 8); + ck_assert_int_eq(rlp_length(&encoder), 8); rlp_free(&encoder); }