Skip to content

Commit

Permalink
Remove base64ct dev dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Ademan committed Dec 15, 2023
1 parent 0340d69 commit f066e50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ rstest = "^0.11"
bdk-testutils = "^0.4"
bdk = { version = "0.28", default-features = true }
electrsd = { version = "0.21", features = ["bitcoind_22_0", "electrs_0_9_1"] }
# base64ct versions at 1.6.0 and higher have MSRV 1.60.0
base64ct = { version = "<1.6.0", features = ["alloc"] }
10 changes: 4 additions & 6 deletions src/reserves.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ fn challenge_txin(message: &str) -> TxIn {
#[cfg(test)]
mod test {
use super::*;
use base64ct::{Base64, Encoding};
use bdk::bitcoin::consensus::encode::deserialize;
use bdk::bitcoin::secp256k1::ecdsa::{SerializedSignature, Signature};
use bdk::bitcoin::{EcdsaSighashType, Network, Witness};
use bdk::wallet::get_funded_wallet;
Expand All @@ -326,8 +324,9 @@ mod test {

let message = "This belongs to me.";
let psbt = wallet.create_proof(message).unwrap();
let psbt_ser = serialize(&psbt);
let psbt_b64 = Base64::encode_string(&psbt_ser);

let psbt_b64 = psbt.to_string();

let expected = r#"cHNidP8BAH4BAAAAAmw1RvG4UzfnSafpx62EPTyha6VslP0Er7n3TxjEpeBeAAAAAAD/////2johM0znoXIXT1lg+ySrvGrtq1IGXPJzpfi/emkV9iIAAAAAAP////8BUMMAAAAAAAAZdqkUn3/QltN+0sDj9/DPySS+70/862iIrAAAAAAAAQEKAAAAAAAAAAABUQEHAAABAR9QwwAAAAAAABYAFOzlJlcQU9qGRUyeBmd56vnRUC5qIgYDKwVYB4vsOGlKhJM9ZZMD4lddrn6RaFkRRUEVv9ZEh+ME7OUmVwAA"#;

assert_eq!(psbt_b64, expected);
Expand Down Expand Up @@ -357,8 +356,7 @@ mod test {

fn get_signed_proof() -> PSBT {
let psbt = "cHNidP8BAH4BAAAAAmw1RvG4UzfnSafpx62EPTyha6VslP0Er7n3TxjEpeBeAAAAAAD/////2johM0znoXIXT1lg+ySrvGrtq1IGXPJzpfi/emkV9iIAAAAAAP////8BUMMAAAAAAAAZdqkUn3/QltN+0sDj9/DPySS+70/862iIrAAAAAAAAQEKAAAAAAAAAAABUQEHAAABAR9QwwAAAAAAABYAFOzlJlcQU9qGRUyeBmd56vnRUC5qAQcAAQhrAkcwRAIgDSE4PQ57JDiZ7otGkTqz35bi/e1pexYaYKWaveuvRd4CIFzVB4sAmgtdEVz2vHzs1iXc9iRKJ+KQOQb+C2DtPyvzASEDKwVYB4vsOGlKhJM9ZZMD4lddrn6RaFkRRUEVv9ZEh+MAAA==";
let psbt = Base64::decode_vec(psbt).unwrap();
deserialize(&psbt).unwrap()
PSBT::from_str(psbt).unwrap()
}

#[test]
Expand Down

0 comments on commit f066e50

Please sign in to comment.