From: Wilfred Allyn Date: Mon, 13 Feb 2023 11:12:29 +0000 (-0500) Subject: Fix broken code in Hello World and Spending Policy tutorials X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/light.css?a=commitdiff_plain;h=d1c9e0e9a85b69ca9af31025214e01f4bbb492d3;p=bitcoindevkit.org Fix broken code in Hello World and Spending Policy tutorials --- diff --git a/docs/tutorials/hello-world.md b/docs/tutorials/hello-world.md index f80f53c742..181273a753 100644 --- a/docs/tutorials/hello-world.md +++ b/docs/tutorials/hello-world.md @@ -130,7 +130,7 @@ let faucet_address = Address::from_str("mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt")?; let mut tx_builder = wallet.build_tx(); tx_builder - .add_recipient(faucet_address.script_pubkey(), balance / 2) + .add_recipient(faucet_address.script_pubkey(), (balance.trusted_pending + balance.confirmed) / 2) .enable_rbf(); let (mut psbt, tx_details) = tx_builder.finish()?; @@ -195,4 +195,4 @@ If you'd like to learn more about the library feel free to ask any questions in [MemoryDatabase]: https://docs.rs/bdk/latest/bdk/database/memory/struct.MemoryDatabase.html [Blockchain]: https://docs.rs/bdk/latest/bdk/blockchain/trait.Blockchain.html [ElectrumBlockchain]: https://docs.rs/bdk/latest/bdk/blockchain/electrum/struct.ElectrumBlockchain.html -[TxBuilder]: https://docs.rs/bdk/latest/bdk/wallet/tx_builder/index.html \ No newline at end of file +[TxBuilder]: https://docs.rs/bdk/latest/bdk/wallet/tx_builder/index.html diff --git a/docs/tutorials/spending_policy_demo.md b/docs/tutorials/spending_policy_demo.md index 06bb01fa87..40a926e8c9 100644 --- a/docs/tutorials/spending_policy_demo.md +++ b/docs/tutorials/spending_policy_demo.md @@ -116,11 +116,11 @@ This descriptor requires spending transaction inputs must be signed by all three Each participant's descriptor only uses their own XPRV key plus the XPUB keys of the other participants. ```bash -export ALICE_DESCRIPTOR="wsh(thresh(3,pk($ALICE_XPRV/84'/1'/0'/0/*),s:pk($BOB_XPUB),s:pk($CAROL_XPUB),sdv:older(2)))" +export ALICE_DESCRIPTOR="wsh(thresh(3,pk($ALICE_XPRV/84'/1'/0'/0/*),s:pk($BOB_XPUB),s:pk($CAROL_XPUB),snl:older(2)))" -export BOB_DESCRIPTOR="wsh(thresh(3,pk($ALICE_XPUB),s:pk($BOB_XPRV/84'/1'/0'/0/*),s:pk($CAROL_XPUB),sdv:older(2)))" +export BOB_DESCRIPTOR="wsh(thresh(3,pk($ALICE_XPUB),s:pk($BOB_XPRV/84'/1'/0'/0/*),s:pk($CAROL_XPUB),snl:older(2)))" -export CAROL_DESCRIPTOR="wsh(thresh(3,pk($ALICE_XPUB),s:pk($BOB_XPUB),s:pk($CAROL_XPRV/84'/1'/0'/0/*),sdv:older(2)))" +export CAROL_DESCRIPTOR="wsh(thresh(3,pk($ALICE_XPUB),s:pk($BOB_XPUB),s:pk($CAROL_XPRV/84'/1'/0'/0/*),snl:older(2)))" ``` ## Policy A. Three signatures