From 3d6caa95a1eaffbea80e50bb244b23b8d2dd1f74 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Mon, 1 Feb 2016 00:34:04 +0100 Subject: [PATCH 1/2] added travis && coveralls badge to README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 216ac8091..6537c0cda 100644 --- a/README.md +++ b/README.md @@ -1 +1,8 @@ # ethcore + +[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] + +[travis-image]: https://travis-ci.com/ethcore/parity.svg?token=DMFvZu71iaTbUYx9UypX&branch=master +[travis-url]: https://travis-ci.com/ethcore/parity +[coveralls-image]: https://coveralls.io/repos/github/ethcore/parity/badge.svg?branch=master&t=Fk0OuQ +[coveralls-url]: https://coveralls.io/r/ethcore/parity?branch=master From 0076df8475869846f89eb054a9c828e608afbc53 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 1 Feb 2016 01:06:21 +0100 Subject: [PATCH 2/2] Fixed neted empty list encoding --- util/src/rlp/rlpstream.rs | 1 + util/src/rlp/tests.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/util/src/rlp/rlpstream.rs b/util/src/rlp/rlpstream.rs index b6b500a74..492d188f8 100644 --- a/util/src/rlp/rlpstream.rs +++ b/util/src/rlp/rlpstream.rs @@ -59,6 +59,7 @@ impl Stream for RlpStream { // we may finish, if the appended list len is equal 0 self.encoder.bytes.push(0xc0u8); self.note_appended(1); + self.finished_list = true; }, _ => { let position = self.encoder.bytes.len(); diff --git a/util/src/rlp/tests.rs b/util/src/rlp/tests.rs index 3b00676f8..faadbe7d2 100644 --- a/util/src/rlp/tests.rs +++ b/util/src/rlp/tests.rs @@ -405,3 +405,11 @@ fn test_rlp_2bytes_data_length_check() assert_eq!(Err(DecoderError::RlpInconsistentLengthAndData), as_val); } +#[test] +fn test_rlp_nested_empty_list_encode() { + let mut stream = RlpStream::new_list(2); + stream.append(&(Vec::new() as Vec)); + stream.append(&40u32); + assert_eq!(stream.drain()[..], [0xc2u8, 0xc0u8, 40u8][..]); +} +