Add Witness::new()
I think it is more natural to write Wintess::new() followed by Witness::push() then Witness::default(). In any case, there is no harm in having additional constructors.
This commit is contained in:
parent
0e2e559712
commit
5d27c15717
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue