diff --git a/bitcoin/src/blockdata/witness.rs b/bitcoin/src/blockdata/witness.rs index b4776adf..8a416c86 100644 --- a/bitcoin/src/blockdata/witness.rs +++ b/bitcoin/src/blockdata/witness.rs @@ -457,6 +457,30 @@ impl<'de> serde::Deserialize<'de> for Witness { } } +impl From>> for Witness { + fn from(vec: Vec>) -> Self { + Witness::from_slice(&vec) + } +} + +impl From<&[&[u8]]> for Witness { + fn from(slice: &[&[u8]]) -> Self { + Witness::from_slice(slice) + } +} + +impl From<&[Vec]> for Witness { + fn from(slice: &[Vec]) -> Self { + Witness::from_slice(slice) + } +} + +impl From> for Witness { + fn from(vec: Vec<&[u8]>) -> Self { + Witness::from_slice(&vec) + } +} + #[cfg(test)] mod test { use super::*;