diff --git a/bip32/src/parser.rs b/bip32/src/parser.rs
index 0a2b2cf..8816548 100644
--- a/bip32/src/parser.rs
+++ b/bip32/src/parser.rs
@@ -91,10 +91,9 @@ where
Error: ParseError,
Error: FromExternalError,
{
- let depth = u8::;
- let parent_fingerprint = fingerprint::;
- let child_number = be_u32::;
- let chain_code = map(take::<_, Input, Error>(32usize), to_fixed_bytes::<_, 32>);
+ let depth = u8;
+ let parent_fingerprint = fingerprint;
+ let child_number = be_u32;
let public_key = map_res(
map(take::<_, Input, Error>(33usize), to_fixed_bytes::<_, 33>),
|pk| PublicKey::from_slice(&pk),
@@ -162,6 +161,17 @@ where
Ok((i, Fingerprint(buf)))
}
+/// Parses a BIP-32 chain code.
+pub fn chain_code(i: Input) -> IResult
+where
+ Input: PartialEq + Clone + Slice> + InputIter- + InputLength,
+ Error: ParseError,
+{
+ let mut buf = [0; 32];
+ let (i, ()) = fill(u8, &mut buf)(i)?;
+ Ok((i, buf))
+}
+
/// Parses a [`KeySource`].
pub fn key_source(i: Input) -> IResult, Error>
where