Skip to content

Commit

Permalink
Format code base using rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
luckysori committed Apr 4, 2024
1 parent e98f0c4 commit d0ed16c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
13 changes: 10 additions & 3 deletions bitcoin-rpc-provider/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,18 @@ impl Wallet for BitcoinCoreProvider {
}

fn unreserve_utxos(&self, outpoints: &[OutPoint]) -> Result<(), ManagerError> {
match self.client.lock().unwrap().unlock_unspent(outpoints).map_err(rpc_err_to_manager_err)? {
match self
.client
.lock()
.unwrap()
.unlock_unspent(outpoints)
.map_err(rpc_err_to_manager_err)?
{
true => Ok(()),
false => Err(ManagerError::StorageError(format!("Failed to unlock utxos: {outpoints:?}")))
false => Err(ManagerError::StorageError(format!(
"Failed to unlock utxos: {outpoints:?}"
))),
}

}
}

Expand Down
2 changes: 1 addition & 1 deletion dlc-manager/src/channel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl std::fmt::Debug for Channel {
Channel::Signed(_) => "signed",
Channel::FailedAccept(_) => "failed accept",
Channel::FailedSign(_) => "failed sign",
Channel::Cancelled(_) => "cancelled"
Channel::Cancelled(_) => "cancelled",
};
f.debug_struct("Contract").field("state", &state).finish()
}
Expand Down
10 changes: 6 additions & 4 deletions dlc-manager/tests/channel_execution_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,13 @@ fn channel_execution_test(test_params: TestParams, path: TestPath) {
assert_channel_state!(alice_manager_send, temporary_channel_id, Offered);

if let TestPath::CancelOffer = path {
let (reject_msg, _) = alice_manager_send.lock().unwrap().reject_channel(&temporary_channel_id).expect("Error rejecting contract offer");
let (reject_msg, _) = alice_manager_send
.lock()
.unwrap()
.reject_channel(&temporary_channel_id)
.expect("Error rejecting contract offer");
assert_channel_state!(alice_manager_send, temporary_channel_id, Cancelled);
alice_send
.send(Some(Message::Reject(reject_msg)))
.unwrap();
alice_send.send(Some(Message::Reject(reject_msg))).unwrap();

sync_receive.recv().expect("Error synchronizing");
assert_channel_state!(bob_manager_send, temporary_channel_id, Cancelled);
Expand Down
2 changes: 2 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
edition = "2021"
max_width = 100

0 comments on commit d0ed16c

Please sign in to comment.