diff --git a/src/commands/utils.rs b/src/commands/utils.rs index 97255649..6bc56473 100644 --- a/src/commands/utils.rs +++ b/src/commands/utils.rs @@ -495,11 +495,9 @@ mod tests { }, schema::{DbTransaction, DbVault}, }, - revaultd::{RevaultD, VaultStatus}, + revaultd::{RevaultD, UserRole, VaultStatus}, setup_db, - utils::test_utils::{ - dummy_revaultd, insert_vault_in_db, test_datadir, MockBitcoindThread, UserRole, - }, + utils::test_utils::{dummy_revaultd, insert_vault_in_db, test_datadir, MockBitcoindThread}, }; use revault_tx::{ bitcoin::{ diff --git a/src/communication.rs b/src/communication.rs index 8100dd2a..ca9b4558 100644 --- a/src/communication.rs +++ b/src/communication.rs @@ -391,13 +391,14 @@ pub fn check_spend_transaction_size(revaultd: &RevaultD, spend_tx: SpendTransact #[cfg(test)] mod tests { + use crate::revaultd::UserRole; use crate::{ communication::*, database::{ bitcointx::{RevaultTx, TransactionType}, schema::DbTransaction, }, - utils::test_utils::{dummy_revaultd, test_datadir, UserRole}, + utils::test_utils::{dummy_revaultd, test_datadir}, }; use revault_net::{ message, sodiumoxide::crypto::box_::curve25519xsalsa20poly1305::gen_keypair, diff --git a/src/database/actions.rs b/src/database/actions.rs index 8b7af898..28507162 100644 --- a/src/database/actions.rs +++ b/src/database/actions.rs @@ -1008,7 +1008,8 @@ pub fn db_mark_rebroadcastable_spend( mod test { use super::*; use crate::database::schema::DbSpendTransaction; - use crate::utils::test_utils::{dummy_revaultd, test_datadir, UserRole}; + use crate::revaultd::UserRole; + use crate::utils::test_utils::{dummy_revaultd, test_datadir}; use revault_tx::{ bitcoin::{ Network, OutPoint, PrivateKey as BitcoinPrivKey, PublicKey as BitcoinPubKey, diff --git a/src/database/interface.rs b/src/database/interface.rs index fb1bb71b..20901d3b 100644 --- a/src/database/interface.rs +++ b/src/database/interface.rs @@ -943,7 +943,8 @@ pub fn db_vaults_with_txids_in_period( mod test { use super::*; use crate::database::actions::{db_confirm_deposit, db_insert_new_unconfirmed_vault, setup_db}; - use crate::utils::test_utils::{dummy_revaultd, test_datadir, UserRole}; + use crate::revaultd::UserRole; + use crate::utils::test_utils::{dummy_revaultd, test_datadir}; use revault_tx::{bitcoin::OutPoint, transactions::transaction_chain}; use std::{fs, str::FromStr}; diff --git a/src/jsonrpc/server.rs b/src/jsonrpc/server.rs index fc648145..05ebf3eb 100644 --- a/src/jsonrpc/server.rs +++ b/src/jsonrpc/server.rs @@ -415,7 +415,8 @@ pub fn rpcserver_loop( #[cfg(test)] mod tests { use super::{read_bytes_from_stream, rpcserver_loop, rpcserver_setup, trimmed}; - use crate::utils::test_utils::{dummy_rpcutil, test_datadir, UserRole}; + use crate::revaultd::UserRole; + use crate::utils::test_utils::{dummy_rpcutil, test_datadir}; use std::{ fs, diff --git a/src/revaultd.rs b/src/revaultd.rs index ea61b165..ad0e5a3b 100644 --- a/src/revaultd.rs +++ b/src/revaultd.rs @@ -276,6 +276,13 @@ pub struct BlockchainTip { pub hash: BlockHash, } +#[derive(Debug, Clone)] +pub enum UserRole { + Stakeholder, + Manager, + ManagerStakeholder, +} + /// Our global state pub struct RevaultD { // Bitcoind stuff diff --git a/src/utils.rs b/src/utils.rs index 1c15990f..25e092be 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -4,7 +4,7 @@ pub mod test_utils { use crate::{ bitcoind::{interface::WalletTransaction, BitcoindError}, database::interface::db_exec, - revaultd::{RevaultD, VaultStatus}, + revaultd::{RevaultD, UserRole, VaultStatus}, threadmessages::{ BitcoindMessageOut, BitcoindSender, BitcoindThread, SigFetcherMessageOut, }, @@ -24,13 +24,6 @@ pub mod test_utils { use rusqlite::params; - #[derive(Debug, Clone)] - pub enum UserRole { - Stakeholder, - Manager, - ManagerStakeholder, - } - pub fn test_datadir() -> PathBuf { static mut COUNTER: u64 = 0; unsafe {