Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed May 17, 2024
1 parent e3f566a commit b5da241
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/swaps/boltzv2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl BoltzApiClientV2 {
Ok(r) => {
println!("{:#?}", r);
r.into_string()?
},
}
Err(ureq::Error::Status(code, response)) => {
print!("{:#?}", response);
let error: Value = serde_json::from_str(&response.into_string()?)?;
Expand Down
8 changes: 4 additions & 4 deletions src/swaps/liquidv2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,10 @@ impl LBtcSwapScriptV2 {
) -> Result<(OutPoint, TxOut), Error> {
let boltz_client = BoltzApiClientV2::new(boltz_url);
let hex = if self.swap_type == SwapType::ReverseSubmarine {
boltz_client.get_reverse_tx(swap_id)?.hex}else{
boltz_client.get_submarine_tx(swap_id)?.hex
};
boltz_client.get_reverse_tx(swap_id)?.hex
} else {
boltz_client.get_submarine_tx(swap_id)?.hex
};

let address = self.to_address(network_config.network())?;
let tx: Transaction = elements::encode::deserialize(&hex_to_bytes(&hex)?)?;
Expand Down Expand Up @@ -748,7 +749,6 @@ impl LBtcSwapTxV2 {
};

claim_tx.input[0].witness = witness;

} else {
// If Non-Cooperative claim use the Script Path spending

Expand Down
18 changes: 13 additions & 5 deletions tests/liquid_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ fn liquid_v2_submarine() {
.submarine_partial_sig(&our_keys, &claim_tx_response)
.unwrap();
boltz_api_v2
.post_claim_tx_details(&create_swap_response.clone().id, pub_nonce, partial_sig)
.post_claim_tx_details(
&create_swap_response.clone().id,
pub_nonce,
partial_sig,
)
.unwrap();
log::info!("Successfully Sent partial signature");
}
Expand All @@ -177,7 +181,6 @@ fn liquid_v2_submarine() {
&ElectrumConfig::default_liquid(),
boltz_url.to_string(),
create_swap_response.clone().id,

)
.unwrap();

Expand Down Expand Up @@ -430,9 +433,14 @@ fn test_recover_liquidv2_refund() {
blinding_key,
);

let rev_swap_tx =
LBtcSwapTxV2::new_refund(swap_script, &RETURN_ADDRESS.to_string(), &network_config, BOLTZ_MAINNET_URL_V2.to_string(), id.clone())
.unwrap();
let rev_swap_tx = LBtcSwapTxV2::new_refund(
swap_script,
&RETURN_ADDRESS.to_string(),
&network_config,
BOLTZ_MAINNET_URL_V2.to_string(),
id.clone(),
)
.unwrap();
let client = BoltzApiClientV2::new(BOLTZ_MAINNET_URL_V2);
let coop = Some((&client, &id));
let signed_tx = rev_swap_tx
Expand Down

0 comments on commit b5da241

Please sign in to comment.