From 52bcd105eb7b87869e3355416b015ced911ab76e Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 10 Mar 2022 17:01:44 -0600 Subject: [PATCH 1/4] Bump version to 0.17.0-rc.1 --- CHANGELOG.md | 5 ++++- Cargo.toml | 2 +- src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ca6b8d5..b939a95a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v0.17.0] - [v0.16.1] + - Removed default verification from `wallet::sync`. sync-time verification is added in `script_sync` and is activated by `verify` feature flag. - `verify` flag removed from `TransactionDetails`. - Add `get_internal_address` to allow you to get internal addresses just as you get external addresses. @@ -415,7 +417,6 @@ final transaction is created by calling `finish` on the builder. - Use `MemoryDatabase` in the compiler example - Make the REPL return JSON -[unreleased]: https://github.com/bitcoindevkit/bdk/compare/v0.11.0...HEAD [0.1.0-beta.1]: https://github.com/bitcoindevkit/bdk/compare/96c87ea5...0.1.0-beta.1 [v0.2.0]: https://github.com/bitcoindevkit/bdk/compare/0.1.0-beta.1...v0.2.0 [v0.3.0]: https://github.com/bitcoindevkit/bdk/compare/v0.2.0...v0.3.0 @@ -434,3 +435,5 @@ final transaction is created by calling `finish` on the builder. [v0.15.0]: https://github.com/bitcoindevkit/bdk/compare/v0.14.0...v0.15.0 [v0.16.0]: https://github.com/bitcoindevkit/bdk/compare/v0.15.0...v0.16.0 [v0.16.1]: https://github.com/bitcoindevkit/bdk/compare/v0.16.0...v0.16.1 +[v0.17.0]: https://github.com/bitcoindevkit/bdk/compare/v0.16.1...v0.17.0 +[unreleased]: https://github.com/bitcoindevkit/bdk/compare/v0.17.0...HEAD \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 3a470dc2..a5ec5a8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bdk" -version = "0.16.2-dev" +version = "0.17.0-rc1" edition = "2018" authors = ["Alekos Filini ", "Riccardo Casatta "] homepage = "https://bitcoindevkit.org" diff --git a/src/lib.rs b/src/lib.rs index 4b8a2228..0779eec4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,7 +44,7 @@ //! interact with the bitcoin P2P network. //! //! ```toml -//! bdk = "0.16.1" +//! bdk = "0.17.0" //! ``` #![cfg_attr( feature = "electrum", From 559cfc4373ffc77947adf5cac2af310ae43d4f4b Mon Sep 17 00:00:00 2001 From: LLFourn Date: Wed, 16 Mar 2022 10:11:31 +1100 Subject: [PATCH 2/4] Fix pre-segwit inputs with esplora --- src/blockchain/esplora/api.rs | 2 +- src/testutils/blockchain_tests.rs | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/blockchain/esplora/api.rs b/src/blockchain/esplora/api.rs index 4e0e3f88..640f7a0b 100644 --- a/src/blockchain/esplora/api.rs +++ b/src/blockchain/esplora/api.rs @@ -17,7 +17,7 @@ pub struct Vin { // None if coinbase pub prevout: Option, pub scriptsig: Script, - #[serde(deserialize_with = "deserialize_witness")] + #[serde(deserialize_with = "deserialize_witness", default)] pub witness: Vec>, pub sequence: u32, pub is_coinbase: bool, diff --git a/src/testutils/blockchain_tests.rs b/src/testutils/blockchain_tests.rs index 6ac91e88..cbbf90a1 100644 --- a/src/testutils/blockchain_tests.rs +++ b/src/testutils/blockchain_tests.rs @@ -1124,6 +1124,36 @@ macro_rules! bdk_blockchain_tests { assert_eq!(tx_2.received, 10_000); assert_eq!(tx_2.sent, 0); } + + #[test] + fn test_send_receive_pkh() { + let descriptors = ("pkh(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)".to_string(), None); + let mut test_client = TestClient::default(); + let blockchain = get_blockchain(&test_client); + + let wallet = get_wallet_from_descriptors(&descriptors); + #[cfg(feature = "test-rpc")] + wallet.sync(&blockchain, SyncOptions::default()).unwrap(); + + let _ = test_client.receive(testutils! { + @tx ( (@external descriptors, 0) => 50_000 ) + }); + + wallet.sync(&blockchain, SyncOptions::default()).unwrap(); + + assert_eq!(wallet.get_balance().unwrap(), 50_000); + + let tx = { + let mut builder = wallet.build_tx(); + builder.add_recipient(test_client.get_node_address(None).script_pubkey(), 25_000); + let (mut psbt, _details) = builder.finish().unwrap(); + wallet.sign(&mut psbt, Default::default()).unwrap(); + psbt.extract_tx() + }; + blockchain.broadcast(&tx).unwrap(); + + wallet.sync(&blockchain, SyncOptions::default()).unwrap(); + } } }; From cac312d34f0153e5844af5bba1c5e1d4d52a28a4 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Mar 2022 11:17:55 -0500 Subject: [PATCH 3/4] Bump version to 0.17.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a5ec5a8f..c28cf648 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bdk" -version = "0.17.0-rc1" +version = "0.17.0" edition = "2018" authors = ["Alekos Filini ", "Riccardo Casatta "] homepage = "https://bitcoindevkit.org" From ce09203431464eb46037ba0717a938b51a55032c Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Fri, 18 Mar 2022 09:35:46 -0500 Subject: [PATCH 4/4] Bump version to 0.17.1-dev --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c28cf648..5ebe0aba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bdk" -version = "0.17.0" +version = "0.17.1-dev" edition = "2018" authors = ["Alekos Filini ", "Riccardo Casatta "] homepage = "https://bitcoindevkit.org"