Merge xmr_btc crate

Created network, storage and protocol modules. Organised
files into the modules where the belong.

xmr_btc crate moved into isolated modulein swap crate.

Remove the xmr_btc module and integrate into swap crate.

Consolidate message related code

Reorganise imports

Remove unused parent Message enum

Remove unused parent State enum

Remove unused dependencies from Cargo.toml
This commit is contained in:
rishflab 2021-01-05 14:08:36 +11:00
parent a0d859147a
commit c900d12593
52 changed files with 1372 additions and 1933 deletions

View file

@ -1,14 +1,15 @@
use crate::{alice::swap::AliceState, SwapAmounts};
use bitcoin::hashes::core::fmt::Display;
use serde::{Deserialize, Serialize};
use xmr_btc::{
alice,
use crate::{
bitcoin::{EncryptedSignature, TxCancel, TxRefund},
monero,
protocol::{alice, alice::swap::AliceState},
serde::monero_private_key,
SwapAmounts,
};
// Large enum variant is fine because this is only used for storage
// Large enum variant is fine because this is only used for database
// and is dropped once written in DB.
#[allow(clippy::large_enum_variant)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]

View file

@ -1,7 +1,10 @@
use crate::{bob::swap::BobState, SwapAmounts};
use bitcoin::hashes::core::fmt::Display;
use serde::{Deserialize, Serialize};
use xmr_btc::bob;
use crate::{
protocol::{bob, bob::swap::BobState},
SwapAmounts,
};
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub enum Bob {