`TaprootMerkleBranchBuf` being a vec introduced intermediate allocation when creating or decoding `Witness`. However the representation on the wire is the same as in-memory (aside from `#[repr(transparent)]`) so this allocation wasn't really needed. This commit introduces `TaprootMerkleBranch` type which is unsized and can be used in place of `TaprootMerkleBranchBuf` within `ControlBlock`. Aside from removing the intermediate allocation, this improves the API a bit: the conversion from array to other type is no longer needed because it's performed by `ControlBlock` in its methods. Thus, consumers who have an array can simply set it as `merkle_branch` field and then encode the `ControlBlock` into witness. A convenience method is also provided to push the `ControlBlock` along with other parts at the end of the `Witness`. |
||
---|---|---|
.. | ||
contrib | ||
embedded | ||
examples | ||
src | ||
tests | ||
CHANGELOG.md | ||
Cargo.toml |