From 401005fde5136fcc099b08521d21e3392f24a689 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 1 Feb 2016 01:03:57 +0100 Subject: [PATCH] Test for Receipt RLP. --- ethcore/src/receipt.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ethcore/src/receipt.rs b/ethcore/src/receipt.rs index d320373d6..306066111 100644 --- a/ethcore/src/receipt.rs +++ b/ethcore/src/receipt.rs @@ -36,3 +36,19 @@ impl Encodable for Receipt { s.append(&self.logs); } } + +#[test] +fn test_basic() { + let expected = Bytes::from("f90162a02f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee83040caeb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000f838f794dcf421d093428b096ca501a7cd1a740855a7976fc0a00000000000000000000000000000000000000000000000000000000000000000"); + let r = Receipt::new( + x!("2f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee"), + x!(0x40cae), + vec![LogEntry::new( + x!("dcf421d093428b096ca501a7cd1a740855a7976f"), + vec![], + vec![0u8; 20] + )] + ); + //, x!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000") + assert_eq!(&encode(&r)[..], &expected[..]); +} \ No newline at end of file