2020-09-28 16:18:50 +10:00
|
|
|
#![warn(
|
|
|
|
unused_extern_crates,
|
|
|
|
missing_debug_implementations,
|
|
|
|
missing_copy_implementations,
|
|
|
|
rust_2018_idioms,
|
|
|
|
clippy::cast_possible_truncation,
|
|
|
|
clippy::cast_sign_loss,
|
|
|
|
clippy::fallible_impl_from,
|
|
|
|
clippy::cast_precision_loss,
|
|
|
|
clippy::cast_possible_wrap,
|
|
|
|
clippy::dbg_macro
|
|
|
|
)]
|
|
|
|
#![cfg_attr(not(test), warn(clippy::unwrap_used))]
|
|
|
|
#![forbid(unsafe_code)]
|
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
2020-12-11 16:49:19 +11:00
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
|
|
pub enum Epoch {
|
|
|
|
T0,
|
|
|
|
T1,
|
|
|
|
T2,
|
|
|
|
}
|
|
|
|
|
2020-10-09 10:17:36 +11:00
|
|
|
#[macro_use]
|
|
|
|
mod utils {
|
|
|
|
|
|
|
|
macro_rules! impl_try_from_parent_enum {
|
|
|
|
($type:ident, $parent:ident) => {
|
|
|
|
impl TryFrom<$parent> for $type {
|
|
|
|
type Error = anyhow::Error;
|
|
|
|
fn try_from(from: $parent) -> Result<Self> {
|
|
|
|
if let $parent::$type(inner) = from {
|
|
|
|
Ok(inner)
|
|
|
|
} else {
|
|
|
|
Err(anyhow::anyhow!(
|
|
|
|
"Failed to convert parent state to child state"
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! impl_from_child_enum {
|
|
|
|
($type:ident, $parent:ident) => {
|
|
|
|
impl From<$type> for $parent {
|
|
|
|
fn from(from: $type) -> Self {
|
|
|
|
$parent::$type(from)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-28 16:18:50 +10:00
|
|
|
pub mod alice;
|
|
|
|
pub mod bitcoin;
|
|
|
|
pub mod bob;
|
2020-12-02 10:00:00 +11:00
|
|
|
pub mod config;
|
2020-09-28 16:18:50 +10:00
|
|
|
pub mod monero;
|
2020-10-14 09:32:25 +11:00
|
|
|
pub mod serde;
|
2020-09-29 15:36:50 +10:00
|
|
|
pub mod transport;
|
2020-10-12 17:17:22 +11:00
|
|
|
|
2020-10-26 11:45:27 +11:00
|
|
|
pub use cross_curve_dleq;
|