Rlp decode returns Result (#8527)

rlp::decode returns Result

Make a best effort to handle decoding errors gracefully throughout the code, using `expect` where the value is guaranteed to be valid (and in other places where it makes sense).
This commit is contained in:
David
2018-05-08 11:22:12 +02:00
committed by GitHub
parent a7a46f4253
commit 28c731881f
28 changed files with 108 additions and 91 deletions

View File

@@ -446,7 +446,7 @@ mod tests {
};
let encoded = ::rlp::encode(&envelope);
let decoded = ::rlp::decode(&encoded);
let decoded = ::rlp::decode(&encoded).expect("failure decoding Envelope");
assert_eq!(envelope, decoded)
}
@@ -462,7 +462,7 @@ mod tests {
};
let encoded = ::rlp::encode(&envelope);
let decoded = ::rlp::decode(&encoded);
let decoded = ::rlp::decode(&encoded).expect("failure decoding Envelope");
assert_eq!(envelope, decoded)
}