mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-05 21:14:32 -04:00
Improve database type safety
The database is now bound to a type eg. alice::State or bob::State. The caller cannot expect to retrieve a type that is different to the type that was stored.
This commit is contained in:
parent
8eda051087
commit
e3b68a3864
4 changed files with 28 additions and 24 deletions
|
@ -82,7 +82,7 @@ pub async fn next_state<
|
|||
}
|
||||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum State {
|
||||
State0(State0),
|
||||
State1(State1),
|
||||
|
|
|
@ -82,7 +82,7 @@ pub async fn next_state<
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum State {
|
||||
State0(State0),
|
||||
State1(State1),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue