diff --git a/core/src/ser.rs b/core/src/ser.rs index 0d7f0bb8c..836ab7517 100644 --- a/core/src/ser.rs +++ b/core/src/ser.rs @@ -37,7 +37,7 @@ use util::secp::constants::{ SECRET_KEY_SIZE, }; -const BULLET_PROOF_SIZE:usize = 674; +const BULLET_PROOF_SIZE: usize = 674; /// Possible errors deriving from serializing or deserializing. #[derive(Debug)] @@ -364,13 +364,13 @@ impl Readable for Identifier { impl Writeable for RangeProof { fn write(&self, writer: &mut W) -> Result<(), Error> { - writer.write_fixed_bytes(self) + writer.write_bytes(self) } } impl Readable for RangeProof { fn read(reader: &mut Reader) -> Result { - let p = try!(reader.read_limited_vec(BULLET_PROOF_SIZE)); + let p = reader.read_limited_vec(BULLET_PROOF_SIZE)?; let mut a = [0; MAX_PROOF_SIZE]; for i in 0..p.len() { a[i] = p[i]; @@ -384,7 +384,7 @@ impl Readable for RangeProof { impl PMMRable for RangeProof { fn len() -> usize { - BULLET_PROOF_SIZE + BULLET_PROOF_SIZE + 8 } }