Skip to content

Commit

Permalink
Use base64 feature from payjoin crate
Browse files Browse the repository at this point in the history
  • Loading branch information
jbesraa committed Aug 25, 2023
1 parent b364352 commit 8f43c73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion payjoin-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions payjoin-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ local-https = ["rcgen", "rouille/ssl"]

[dependencies]
anyhow = "1.0.70"
base64 = "0.13.0"
bip21 = "0.3.1"
bitcoincore-rpc = "0.17.0"
clap = "4.1.4"
config = "0.13.3"
env_logger = "0.9.0"
log = "0.4.7"
payjoin = { path = "../payjoin", features = ["send", "receive"] }
payjoin = { path = "../payjoin", features = ["send", "receive", "base64"] }
reqwest = { version = "0.11.4", features = ["blocking"] }
rcgen = { version = "0.11.1", optional = true }
rouille = "3.6.2"
Expand Down
6 changes: 3 additions & 3 deletions payjoin-cli/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl App {
|psbt: &Psbt| {
self.bitcoind
.wallet_process_psbt(
&bitcoin::base64::encode(psbt.serialize()),
&payjoin::base64::encode(psbt.serialize()),
None,
None,
Some(false),
Expand All @@ -337,7 +337,7 @@ impl App {
let payjoin_proposal_psbt = payjoi_proposal.psbt();
log::debug!("Receiver's Payjoin proposal PSBT Rsponse: {:#?}", payjoin_proposal_psbt);

let payload = base64::encode(&payjoin_proposal_psbt.serialize());
let payload = payjoin::base64::encode(&payjoin_proposal_psbt.serialize());
log::info!("successful response");
Ok(Response::text(payload))
}
Expand Down Expand Up @@ -488,4 +488,4 @@ impl payjoin::receive::Headers for Headers<'_> {
}
}

fn serialize_psbt(psbt: &Psbt) -> String { base64::encode(&psbt.serialize()) }
fn serialize_psbt(psbt: &Psbt) -> String { payjoin::base64::encode(&psbt.serialize()) }

0 comments on commit 8f43c73

Please sign in to comment.