5d27c15717 Add Witness::new() (sanket1729)

Pull request description:

  Rebasing rust-miniscript on rust-bitcoin master. Expect more trivial PRs :)

ACKs for top commit:
  dr-orlovsky:
    ACK 5d27c15717
  apoelstra:
    ACK 5d27c15717

Tree-SHA512: f1b6b1bba1ba6f153416be514b53d64bb6ba0c1cc1f182857f5010a048004f884d5c36ef96f6e27837bf682d781e3a4375bf2303e1f53685019406e88e192a03
This commit is contained in:
Andrew Poelstra 2022-01-11 14:47:53 +00:00
commit d9bc48f12f
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 6 additions and 0 deletions

View File

@ -120,6 +120,12 @@ impl Encodable for Witness {
} }
impl Witness { impl Witness {
/// Create a new empty [`Witness`]
pub fn new() -> Self {
Witness::default()
}
/// Creates [`Witness`] object from an array of byte-arrays /// Creates [`Witness`] object from an array of byte-arrays
pub fn from_vec(vec: Vec<Vec<u8>>) -> Self { pub fn from_vec(vec: Vec<Vec<u8>>) -> Self {
let witness_elements = vec.len(); let witness_elements = vec.len();