Skip to content

Commit

Permalink
integration tests updated
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinZavior committed Jul 18, 2024
1 parent 93ded99 commit e4201d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 1 addition & 5 deletions tests/bdk_integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,6 @@ fn handle_proposal(proposal: UncheckedProposal, receiver: Wallet) -> Arc<Payjoin
.contribute_witness_input(txo_to_contribute, outpoint_to_contribute)
.expect("contribute_witness_input error");

let receiver_substitute_address = receiver.get_address(AddressIndex::New).to_string();
payjoin
.substitute_output_address(receiver_substitute_address)
.expect("substitute_output_address error");
let payjoin_proposal = payjoin
.finalize_proposal(
|e| {
Expand Down Expand Up @@ -355,7 +351,7 @@ mod v1 {
let psbt = build_original_psbt(&sender, &pj_uri)?;
println!("\nOriginal sender psbt: {:#?}", psbt.to_string());

let req_ctx = RequestBuilder::from_psbt_and_uri(psbt.to_string(), Arc::new(pj_uri))?
let req_ctx = RequestBuilder::from_psbt_and_uri(psbt.to_string(), Arc::new(pj_uri.check_pj_supported().unwrap()))?
.build_with_additional_fee(10000, None, 0, false)?
.extract_v1()?;
let headers = Headers::from_vec(req_ctx.request.body.clone());
Expand Down
8 changes: 3 additions & 5 deletions tests/bitcoin_core_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ fn v1_to_v1_full_cycle() -> Result<(), BoxError> {
pj_receiver_address.to_string(),
Url::from_str("https://example.com".to_string())?,
None,
None,
)?
.amount(0.0083285)
.amount(832_850)
.build()
.as_string();
print!("pj_uri {}", pj_uri_string);
Expand Down Expand Up @@ -60,7 +61,7 @@ fn v1_to_v1_full_cycle() -> Result<(), BoxError> {
.psbt;
let psbt_base64 = sender.wallet_process_psbt(&psbt, None, None, None)?.psbt;
eprintln!("Original psbt: {:#?}", psbt_base64);
let req_ctx = RequestBuilder::from_psbt_and_uri(psbt_base64, Arc::new(pj_uri))?
let req_ctx = RequestBuilder::from_psbt_and_uri(psbt_base64, Arc::new(pj_uri.check_pj_supported().unwrap()))?
.build_with_additional_fee(10000, None, 0, false)?
.extract_v1()?;
let req = req_ctx.request;
Expand Down Expand Up @@ -175,9 +176,6 @@ fn handle_pj_proposal(proposal: UncheckedProposal, receiver: Arc<Client>) -> Arc
.contribute_witness_input(txo_to_contribute, outpoint_to_contribute)
.expect("contribute_witness_input error");

let receiver_substitute_address =
receiver.get_new_address(None, None).unwrap().assume_checked();
payjoin.substitute_output_address(receiver_substitute_address.to_string()).unwrap();
let payjoin_proposal = payjoin
.finalize_proposal(
|e| {
Expand Down

0 comments on commit e4201d7

Please sign in to comment.