Skip to content

Commit

Permalink
rpc_api: Delete database connections.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunsen committed Jun 10, 2024
1 parent 4fcf394 commit af6fc08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//! Client crate mocks the `Client` struct in `bitcoincore-rpc`.
use crate::ledger::Ledger;
use bitcoin_simulator::database::Database;

mod rpc_api;

Expand All @@ -23,11 +22,8 @@ impl Client {
///
/// # Panics
///
/// This function will panic if connection to the SQLite database cannot be
/// established.
/// This function can panic if `Ledger` can't be created.
pub fn new(_url: &str, _auth: bitcoincore_rpc::Auth) -> bitcoincore_rpc::Result<Self> {
let database = Database::connect_temporary_database().unwrap();

Ok(Self {
ledger: Ledger::new(),
})
Expand Down
4 changes: 2 additions & 2 deletions src/client/rpc_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ mod tests {
value: Amount::from_sat(1),
script_pubkey: address.script_pubkey(),
};
let tx = Transaction {
let _tx = Transaction {
version: bitcoin::transaction::Version(2),
lock_time: absolute::LockTime::from_consensus(0),
input: vec![],
Expand All @@ -367,7 +367,7 @@ mod tests {
value: Amount::from_sat(1),
script_pubkey: address.script_pubkey(),
};
let tx = Transaction {
let _tx = Transaction {
version: bitcoin::transaction::Version(2),
lock_time: absolute::LockTime::from_consensus(0),
input: vec![],
Expand Down

0 comments on commit af6fc08

Please sign in to comment.