Skip to content

Commit

Permalink
Merge pull request #102 from jbesraa/rexport-base64-from-bitcoin-crate
Browse files Browse the repository at this point in the history
Rexport base64 as a feature from bitcoin crate
  • Loading branch information
DanGould authored Aug 27, 2023
2 parents 0c6a2e5 + fb341d7 commit d0cde61
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
cargo update -p log --precise 0.4.18
cargo update -p tempfile --precise 3.6.0
cargo update -p flate2 --precise 1.0.26
cargo update -p minreq --precise 2.8.0
- name: test
run: cargo test --verbose --all-features --lib

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ To build and test with the MSRV you will need to pin the below dependency versio
cargo update -p log --precise 0.4.18
cargo update -p tempfile --precise 3.6.0
cargo update -p flate2 --precise 1.0.26
cargo update -p minreq --precise 2.8.0
```

## License
Expand Down
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()) }
3 changes: 2 additions & 1 deletion payjoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ edition = "2018"
[features]
send = []
receive = ["rand"]
base64 = ["bitcoin/base64"]

[dependencies]
bitcoin = { version = "0.30.0", features = ["base64"] }
Expand All @@ -28,4 +29,4 @@ env_logger = "0.9.0"
bitcoind = { version = "0.31.1", features = ["0_21_2"] }

[package.metadata.docs.rs]
features = ["send", "receive"]
features = ["send", "receive", "base64"]
2 changes: 2 additions & 0 deletions payjoin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ mod uri;
#[cfg(any(feature = "send", feature = "receive"))]
pub(crate) mod weight;

#[cfg(feature = "base64")]
pub use bitcoin::base64;
pub use uri::{PjParseError, PjUri, PjUriExt, Uri, UriExt};

0 comments on commit d0cde61

Please sign in to comment.