From 142ea5dd209c982c092110bea521f3f8924ffc6a Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Sat, 21 Sep 2024 13:16:03 +0900 Subject: [PATCH] Rename `Script` to `ScriptBuf` Previously, we exposed `bitcoin::ScriptBuf` as `Script` which is pretty confusing given `bitcoin::Script` exists. Here, we rename `Script` to `ScriptBuf` to align the type names with `rust-bitcoin`. --- src/bitcoin.udl | 10 +++++----- src/lib.rs | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/bitcoin.udl b/src/bitcoin.udl index c4ddc21..6f6571b 100644 --- a/src/bitcoin.udl +++ b/src/bitcoin.udl @@ -4,7 +4,7 @@ namespace bitcoin {}; // Core types // ------------------------------------------------------------------------ -interface Script { +interface ScriptBuf { constructor(sequence raw_output_script); sequence to_bytes(); @@ -49,7 +49,7 @@ dictionary OutPoint { dictionary TxIn { OutPoint previous_output; - Script script_sig; + ScriptBuf script_sig; u32 sequence; sequence> witness; }; @@ -68,9 +68,9 @@ interface Address { constructor(string address, Network network); [Name=from_script, Throws=FromScriptError] - constructor(Script script, Network network); + constructor(ScriptBuf script, Network network); - Script script_pubkey(); + ScriptBuf script_pubkey(); string to_qr_uri(); @@ -79,7 +79,7 @@ interface Address { dictionary TxOut { Amount value; - Script script_pubkey; + ScriptBuf script_pubkey; }; // ------------------------------------------------------------------------ diff --git a/src/lib.rs b/src/lib.rs index 19d5652..e7d54d5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,9 +3,9 @@ use bitcoin::Address as BitcoinAddress; use bitcoin::Amount as BitcoinAmount; use bitcoin::FeeRate as BitcoinFeeRate; use bitcoin::ScriptBuf as BitcoinScriptBuf; +use bitcoin::Sequence; use bitcoin::TxIn as BitcoinTxIn; use bitcoin::TxOut as BitcoinTxOut; -use bitcoin::Sequence; pub use bitcoin::BlockHash; pub use bitcoin::OutPoint; @@ -35,13 +35,13 @@ impl Address { Ok(Address(network_checked_address)) } - pub fn from_script(script: Arc