gemachain_program/nonce/state/
mod.rs

1mod current;
2pub use current::{Data, State};
3
4use serde_derive::{Deserialize, Serialize};
5
6#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
7pub enum Versions {
8    Current(Box<State>),
9}
10
11impl Versions {
12    pub fn new_current(state: State) -> Self {
13        Self::Current(Box::new(state))
14    }
15
16    pub fn convert_to_current(self) -> State {
17        match self {
18            Self::Current(state) => *state,
19        }
20    }
21}