diff --git a/util/src/rlp/rlpstream.rs b/util/src/rlp/rlpstream.rs index 7bf3d3cddd9..c2ff88c41c9 100644 --- a/util/src/rlp/rlpstream.rs +++ b/util/src/rlp/rlpstream.rs @@ -307,10 +307,14 @@ struct EncodableU8 (u8); impl ByteEncodable for EncodableU8 { fn to_bytes>(&self, out: &mut V) { - out.vec_push(self.0) + if self.0 != 0 { + out.vec_push(self.0) + } } - fn bytes_len(&self) -> usize { 1 } + fn bytes_len(&self) -> usize { + match self.0 { 0 => 0, _ => 1 } + } } impl RlpEncodable for u8 {