Use bitcoin's base64 feature for Psbts

This commit is contained in:
Riccardo Casatta
2021-06-10 15:14:00 +02:00
parent 12de13b95c
commit fe371f9d92
5 changed files with 18 additions and 21 deletions

View File

@@ -104,8 +104,6 @@ fn main() -> Result<(), bdk::Error> {
### Example
```no_run
use base64::decode;
use bdk::{FeeRate, Wallet};
use bdk::database::MemoryDatabase;
use bdk::blockchain::{noop_progress, ElectrumBlockchain};
@@ -138,7 +136,7 @@ fn main() -> Result<(), bdk::Error> {
};
println!("Transaction details: {:#?}", details);
println!("Unsigned PSBT: {}", base64::encode(&serialize(&psbt)));
println!("Unsigned PSBT: {}", &psbt);
Ok(())
}
@@ -150,8 +148,9 @@ fn main() -> Result<(), bdk::Error> {
//!
//! ### Example
//! ```no_run
//! use base64::decode;
//! use bitcoin::consensus::deserialize;
//! use std::str::FromStr;
//!
//! use bitcoin::util::psbt::PartiallySignedTransaction as Psbt;
//!
//! use bdk::{Wallet, SignOptions};
//! use bdk::database::MemoryDatabase;
@@ -165,7 +164,7 @@ fn main() -> Result<(), bdk::Error> {
//! )?;
//!
//! let psbt = "...";
//! let mut psbt = deserialize(&base64::decode(psbt).unwrap())?;
//! let mut psbt = Psbt::from_str(psbt)?;
//!
//! let finalized = wallet.sign(&mut psbt, SignOptions::default())?;
//!