mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-08 22:42:35 -04:00
Reorganise modules for multiple database implementations
This commit is contained in:
parent
0e4891fcc0
commit
a94c320021
15 changed files with 464 additions and 453 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::bitcoin::{parse_rpc_error_code, RpcErrorCode, Txid, Wallet};
|
||||
use crate::database::{Database, Swap};
|
||||
use crate::database::{SledDatabase, Swap};
|
||||
use crate::protocol::bob::BobState;
|
||||
use anyhow::{bail, Result};
|
||||
use std::sync::Arc;
|
||||
|
@ -8,7 +8,7 @@ use uuid::Uuid;
|
|||
pub async fn cancel(
|
||||
swap_id: Uuid,
|
||||
bitcoin_wallet: Arc<Wallet>,
|
||||
db: Database,
|
||||
db: SledDatabase,
|
||||
) -> Result<(Txid, BobState)> {
|
||||
let state = db.get_state(swap_id)?.try_into_bob()?.into();
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
use crate::bitcoin::Wallet;
|
||||
use crate::database::{Database, Swap};
|
||||
use crate::database::{SledDatabase, Swap};
|
||||
use crate::protocol::bob::BobState;
|
||||
use anyhow::{bail, Result};
|
||||
use std::sync::Arc;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub async fn refund(swap_id: Uuid, bitcoin_wallet: Arc<Wallet>, db: Database) -> Result<BobState> {
|
||||
pub async fn refund(
|
||||
swap_id: Uuid,
|
||||
bitcoin_wallet: Arc<Wallet>,
|
||||
db: SledDatabase,
|
||||
) -> Result<BobState> {
|
||||
let state = db.get_state(swap_id)?.try_into_bob()?.into();
|
||||
|
||||
let state6 = match state {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue