Merge branch 'master' into coverage-effort

Conflicts:
	ethcore/src/receipt.rs
This commit is contained in:
Nikolay Volf
2016-02-01 16:37:08 +04:00
16 changed files with 203 additions and 39 deletions

View File

@@ -37,18 +37,18 @@ impl Encodable for Receipt {
}
}
#[cfg(test)]
mod tests {
use super::*;
use util::*;
#[test]
fn it_can_be_encoded() {
let mut rlp_stream = RlpStream::new();
let receipt = Receipt::new(H256::zero(), U256::zero(), vec![]);
rlp_stream.append(&receipt);
let out = rlp_stream.out();
assert_eq!(out.len(), 297);
}
#[test]
fn test_basic() {
let expected = FromHex::from_hex("f90162a02f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee83040caeb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000f838f794dcf421d093428b096ca501a7cd1a740855a7976fc0a00000000000000000000000000000000000000000000000000000000000000000").unwrap();
let r = Receipt::new(
x!("2f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee"),
x!(0x40cae),
vec![LogEntry::new(
x!("dcf421d093428b096ca501a7cd1a740855a7976f"),
vec![],
vec![0u8; 32]
)]
);
assert_eq!(&encode(&r)[..], &expected[..]);
}