From 1e3f09f3ce57fabe7107638dfd8e47774ac122d2 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Tue, 11 Feb 2020 16:51:34 +0000 Subject: [PATCH 1/3] Add wtxid method for Transaction --- src/transaction.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/transaction.rs b/src/transaction.rs index 0d5369be..561eae53 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -596,8 +596,16 @@ impl Transaction { self.lock_time.consensus_encode(&mut enc).unwrap(); bitcoin::Txid::from_engine(enc) } + + /// Get the witness txid of the transaction. + pub fn wtxid(&self) -> bitcoin::Wtxid { + let mut enc = Txid::engine(); + self.consensus_encode(&mut enc).unwrap(); + bitcoin::Wtxid::from_engine(enc) + } } +//TODO(stevenroose) remove this, it's incorrect impl BitcoinHash for Transaction { /// To get a transaction's txid, which is usually what you want, use the `txid` method. fn bitcoin_hash(&self) -> Txid { From 447f490468ef11f53daf1f6abd3e3e7de75d709d Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Tue, 11 Feb 2020 16:52:16 +0000 Subject: [PATCH 2/3] Bump to v0.12.1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5ae96727..5d37ddda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "elements" -version = "0.12.0" +version = "0.12.1" authors = ["Andrew Poelstra "] description = "Library with support for de/serialization, parsing and executing on data structures and network messages related to Elements" license = "CC0-1.0" From 715aa7fc9ff52ea0b6d025f203e0d5c6aae4e0be Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Fri, 14 Feb 2020 17:08:58 +0000 Subject: [PATCH 3/3] Limit serde_json dev dep to fix Rust 1.22 build --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5d37ddda..3f75cfc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,4 +24,4 @@ optional = true [dev-dependencies] rand = "0.6.5" -serde_json = "1" +serde_json = "<=1.0.44"