Add `Script::builder` convenience function

This commit is contained in:
Casey Rodarmor 2022-10-07 14:25:21 -07:00
parent f6d838076e
commit 2bae74688e
1 changed files with 5 additions and 0 deletions

View File

@ -354,6 +354,11 @@ impl Script {
/// Creates a new empty script. /// Creates a new empty script.
pub fn new() -> Script { Script(vec![].into_boxed_slice()) } pub fn new() -> Script { Script(vec![].into_boxed_slice()) }
/// Creates a new script builder
pub fn builder() -> Builder {
Builder::new()
}
/// Generates P2PK-type of scriptPubkey. /// Generates P2PK-type of scriptPubkey.
pub fn new_p2pk(pubkey: &PublicKey) -> Script { pub fn new_p2pk(pubkey: &PublicKey) -> Script {
Builder::new() Builder::new()