Skip to content

Commit 5795be2

Browse files
committed
Use BIP 78 spec terms in payjoin-cli prints
The CLI called the request to the receiver a "fallback request" and the post-send tx info "Sent fallback transaction ...". The request body is the Original PSBT in BIP 78 parlance, and the fallback transaction is the signed original tx -- which we have not sent at that point, only computed. Tighten the wording to match the spec. Also rename "Posted original proposal..." to "Posted Original PSBT..." for the v2 sender path. The internal name "Original Proposal" stays in BIP 77 (Original PSBT plus extra params); only the user-facing print is changed.
1 parent 13c3856 commit 5795be2

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

payjoin-cli/src/app/v1.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl AppTrait for App {
7070
.create_v1_post_request();
7171
let http = http_agent(&self.config)?;
7272
let body = String::from_utf8(req.body.clone()).unwrap();
73-
println!("Sending fallback request to {}", req.url);
73+
println!("Sending Original PSBT to {}", req.url);
7474
let response = http
7575
.post(req.url)
7676
.header("Content-Type", req.content_type)
@@ -81,9 +81,9 @@ impl AppTrait for App {
8181
let fallback_tx = Psbt::from_str(&body)
8282
.map_err(|e| anyhow!("Failed to load PSBT from base64: {}", e))?
8383
.extract_tx()?;
84-
println!("Sent fallback transaction txid: {}", fallback_tx.compute_txid());
84+
println!("Fallback transaction txid: {}", fallback_tx.compute_txid());
8585
println!(
86-
"Sent fallback transaction hex: {:#}",
86+
"Fallback transaction hex: {:#}",
8787
payjoin::bitcoin::consensus::encode::serialize_hex(&fallback_tx)
8888
);
8989
let psbt = ctx.process_response(&response.bytes().await?).map_err(|e| {

payjoin-cli/src/app/v2/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl AppTrait for App {
180180
.create_v1_post_request();
181181
let http = http_agent(&self.config)?;
182182
let body = String::from_utf8(req.body.clone()).unwrap();
183-
println!("Sending fallback request to {}", req.url);
183+
println!("Sending Original PSBT to {}", req.url);
184184
let response = http
185185
.post(req.url)
186186
.header("Content-Type", req.content_type)
@@ -191,9 +191,9 @@ impl AppTrait for App {
191191
let fallback_tx = payjoin::bitcoin::Psbt::from_str(&body)
192192
.map_err(|e| anyhow!("Failed to load PSBT from base64: {}", e))?
193193
.extract_tx()?;
194-
println!("Sent fallback transaction txid: {}", fallback_tx.compute_txid());
194+
println!("Fallback transaction txid: {}", fallback_tx.compute_txid());
195195
println!(
196-
"Sent fallback transaction hex: {:#}",
196+
"Fallback transaction hex: {:#}",
197197
payjoin::bitcoin::consensus::encode::serialize_hex(&fallback_tx)
198198
);
199199
let psbt = ctx.process_response(&response.bytes().await?).map_err(|e| {
@@ -504,7 +504,7 @@ impl App {
504504
)?;
505505
let response = self.post_request(req).await?;
506506
let sender = sender.process_response(&response.bytes().await?, ctx).save(persister)?;
507-
println!("Posted original proposal...");
507+
println!("Posted Original PSBT...");
508508
self.get_proposed_payjoin_psbt(sender, persister).await
509509
}
510510

0 commit comments

Comments
 (0)