1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#![deny(rust_2018_idioms)]
#![deny(clippy::all)]
#![deny(rustdoc::broken_intra_doc_links)]
#![cfg_attr(docsrs, feature(doc_cfg))]
pub use {
self::adapter::{
state::{LockedState, UnlockedState},
Adapter,
},
dummy::Dummy,
error::Error,
ethereum::Ethereum,
};
pub mod primitives {
use serde::{Deserialize, Serialize};
pub use ::primitives::{
config::{ChainInfo, Config, TokenInfo},
Address, BigNum, Chain, ChainId, ChainOf, Channel, ValidatorId,
};
use crate::ethereum::WalletState;
pub type Deposit = ::primitives::Deposit<primitives::BigNum>;
pub enum AdapterTypes<S, ES> {
Dummy(Box<crate::dummy::Adapter<S>>),
Ethereum(Box<crate::Adapter<crate::Ethereum<ES>, S>>),
}
impl<S, ES: WalletState> AdapterTypes<S, ES> {
pub fn dummy(dummy: crate::dummy::Adapter<S>) -> Self {
Self::Dummy(Box::new(dummy))
}
pub fn ethereum(ethereum: crate::Adapter<crate::Ethereum<ES>, S>) -> Self {
Self::Ethereum(Box::new(ethereum))
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Session {
pub era: i64,
pub uid: Address,
pub chain: Chain,
}
}
pub mod prelude {
pub use crate::client::{Locked, Unlockable, Unlocked};
pub use crate::{LockedState, UnlockedState};
}
mod adapter;
pub mod client;
pub mod dummy;
mod error;
pub mod ethereum;
pub mod util;