From 8c7964bfeec2ba7a676324ea116aa943eed7b818 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 23 Dec 2020 15:17:27 +1100 Subject: [PATCH] Rename storage.rs to database.rs to reduce terminology variants --- swap/src/alice/swap.rs | 2 +- swap/src/bob/swap.rs | 2 +- swap/src/{storage.rs => database.rs} | 0 swap/src/lib.rs | 2 +- swap/src/main.rs | 2 +- swap/tests/happy_path_restart_alice.rs | 2 +- swap/tests/happy_path_restart_bob_after_comm.rs | 2 +- swap/tests/happy_path_restart_bob_before_comm.rs | 2 +- swap/tests/refund_restart_alice.rs | 2 +- swap/tests/testutils/mod.rs | 4 ++-- 10 files changed, 10 insertions(+), 10 deletions(-) rename swap/src/{storage.rs => database.rs} (100%) diff --git a/swap/src/alice/swap.rs b/swap/src/alice/swap.rs index fcaef8f3..3c220bf8 100644 --- a/swap/src/alice/swap.rs +++ b/swap/src/alice/swap.rs @@ -11,9 +11,9 @@ use crate::{ }, }, bitcoin::EncryptedSignature, + database::Database, network::request_response::AliceToBob, state::Swap, - storage::Database, SwapAmounts, }; use anyhow::Result; diff --git a/swap/src/bob/swap.rs b/swap/src/bob/swap.rs index 0d770bca..7f004cea 100644 --- a/swap/src/bob/swap.rs +++ b/swap/src/bob/swap.rs @@ -1,4 +1,4 @@ -use crate::{bob::event_loop::EventLoopHandle, state, storage::Database, SwapAmounts}; +use crate::{bob::event_loop::EventLoopHandle, database::Database, state, SwapAmounts}; use anyhow::{bail, Result}; use async_recursion::async_recursion; use rand::{CryptoRng, RngCore}; diff --git a/swap/src/storage.rs b/swap/src/database.rs similarity index 100% rename from swap/src/storage.rs rename to swap/src/database.rs diff --git a/swap/src/lib.rs b/swap/src/lib.rs index fc16a59f..7ee2a4be 100644 --- a/swap/src/lib.rs +++ b/swap/src/lib.rs @@ -20,10 +20,10 @@ pub mod alice; pub mod bitcoin; pub mod bob; pub mod cli; +pub mod database; pub mod monero; pub mod network; pub mod state; -pub mod storage; pub mod trace; pub type Never = std::convert::Infallible; diff --git a/swap/src/main.rs b/swap/src/main.rs index a9785213..5230ec1a 100644 --- a/swap/src/main.rs +++ b/swap/src/main.rs @@ -25,10 +25,10 @@ use swap::{ bitcoin, bob, bob::swap::BobState, cli::{Command, Options, Resume}, + database::Database, monero, network::transport::build, state::Swap, - storage::Database, trace::init_tracing, SwapAmounts, }; diff --git a/swap/tests/happy_path_restart_alice.rs b/swap/tests/happy_path_restart_alice.rs index d2dfd9d8..d1601e9b 100644 --- a/swap/tests/happy_path_restart_alice.rs +++ b/swap/tests/happy_path_restart_alice.rs @@ -2,7 +2,7 @@ use crate::testutils::{init_alice, init_bob}; use get_port::get_port; use libp2p::Multiaddr; use rand::rngs::OsRng; -use swap::{alice, alice::swap::AliceState, bitcoin, bob, storage::Database}; +use swap::{alice, alice::swap::AliceState, bitcoin, bob, database::Database}; use tempfile::tempdir; use testcontainers::clients::Cli; use testutils::init_tracing; diff --git a/swap/tests/happy_path_restart_bob_after_comm.rs b/swap/tests/happy_path_restart_bob_after_comm.rs index a3ec875d..eae3f9a0 100644 --- a/swap/tests/happy_path_restart_bob_after_comm.rs +++ b/swap/tests/happy_path_restart_bob_after_comm.rs @@ -2,7 +2,7 @@ use crate::testutils::{init_alice, init_bob}; use get_port::get_port; use libp2p::Multiaddr; use rand::rngs::OsRng; -use swap::{alice, bitcoin, bob, bob::swap::BobState, storage::Database}; +use swap::{alice, bitcoin, bob, bob::swap::BobState, database::Database}; use tempfile::tempdir; use testcontainers::clients::Cli; use testutils::init_tracing; diff --git a/swap/tests/happy_path_restart_bob_before_comm.rs b/swap/tests/happy_path_restart_bob_before_comm.rs index 63197e8f..ede14655 100644 --- a/swap/tests/happy_path_restart_bob_before_comm.rs +++ b/swap/tests/happy_path_restart_bob_before_comm.rs @@ -2,7 +2,7 @@ use crate::testutils::{init_alice, init_bob}; use get_port::get_port; use libp2p::Multiaddr; use rand::rngs::OsRng; -use swap::{alice, alice::swap::AliceState, bitcoin, bob, bob::swap::BobState, storage::Database}; +use swap::{alice, alice::swap::AliceState, bitcoin, bob, bob::swap::BobState, database::Database}; use tempfile::tempdir; use testcontainers::clients::Cli; use testutils::init_tracing; diff --git a/swap/tests/refund_restart_alice.rs b/swap/tests/refund_restart_alice.rs index 4ebcd2fe..58fc7ee7 100644 --- a/swap/tests/refund_restart_alice.rs +++ b/swap/tests/refund_restart_alice.rs @@ -3,7 +3,7 @@ use futures::future::try_join; use get_port::get_port; use libp2p::Multiaddr; use rand::rngs::OsRng; -use swap::{alice, alice::swap::AliceState, bob, bob::swap::BobState, storage::Database}; +use swap::{alice, alice::swap::AliceState, bob, bob::swap::BobState, database::Database}; use tempfile::tempdir; use testcontainers::clients::Cli; use testutils::init_tracing; diff --git a/swap/tests/testutils/mod.rs b/swap/tests/testutils/mod.rs index 3ad2633a..6ec96aae 100644 --- a/swap/tests/testutils/mod.rs +++ b/swap/tests/testutils/mod.rs @@ -4,8 +4,8 @@ use monero_harness::{image, Monero}; use rand::rngs::OsRng; use std::sync::Arc; use swap::{ - alice, alice::swap::AliceState, bitcoin, bob, bob::swap::BobState, monero, - network::transport::build, storage::Database, SwapAmounts, + alice, alice::swap::AliceState, bitcoin, bob, bob::swap::BobState, database::Database, monero, + network::transport::build, SwapAmounts, }; use tempfile::tempdir; use testcontainers::{clients::Cli, Container};