use serde::Serialize;
pub type Method = fil_actor_evm_state::v10::Method;
#[derive(Serialize, Debug)]
#[serde(untagged)]
pub enum State {
V10(fil_actor_evm_state::v10::State),
V11(fil_actor_evm_state::v11::State),
V12(fil_actor_evm_state::v12::State),
V13(fil_actor_evm_state::v13::State),
V14(fil_actor_evm_state::v14::State),
}
impl State {
pub fn nonce(&self) -> u64 {
match self {
State::V10(st) => st.nonce,
State::V11(st) => st.nonce,
State::V12(st) => st.nonce,
State::V13(st) => st.nonce,
State::V14(st) => st.nonce,
}
}
pub fn is_alive(&self) -> bool {
match self {
State::V10(st) => st.tombstone.is_none(),
State::V11(st) => st.tombstone.is_none(),
State::V12(st) => st.tombstone.is_none(),
State::V13(st) => st.tombstone.is_none(),
State::V14(st) => st.tombstone.is_none(),
}
}
}