Skip to content

Commit ea2b732

Browse files
committed
Remove extraneous bytes check on input buffer
1 parent 355661a commit ea2b732

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/v0/mod.rs

+12-14
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,16 @@ impl Decode for DoughnutV0 {
215215
let mut signature = [0_u8; 64];
216216
input.read(&mut signature)?;
217217

218-
if input.read_byte().is_ok() {
219-
Err(codec::Error::from("Doughnut contains unexpected bytes"))
220-
} else {
221-
Ok(Self {
222-
holder,
223-
issuer,
224-
expiry,
225-
not_before,
226-
signature_version,
227-
payload_version,
228-
domains,
229-
signature: H512::from(signature),
230-
})
231-
}
218+
Ok(Self {
219+
holder,
220+
issuer,
221+
expiry,
222+
not_before,
223+
signature_version,
224+
payload_version,
225+
domains,
226+
signature: H512::from(signature),
227+
})
232228
}
233229
}
234230

@@ -579,6 +575,8 @@ mod test {
579575
);
580576
}
581577

578+
// TODO: reconcile once https://github.com/cennznet/doughnut-rs/issues/67 is solved
579+
#[ignore]
582580
#[test]
583581
fn decode_error_with_too_many_bytes() {
584582
let doughnut = doughnut_builder!();

0 commit comments

Comments
 (0)