cycles-quartz/apps/transfers/enclave/src/state.rs
Daniel Gushchyan 47544c66ae
feat: decoupling quartz from applications, creating transfers app (#64)
Co-authored-by: hu55a1n1 <sufialhussaini@gmail.com>
Co-authored-by: Ethan Buchman <ethan@coinculture.info>
Co-authored-by: David Kajpust <kajpustd@gmail.com>
2024-06-26 23:31:01 +04:00

35 lines
746 B
Rust

use std::collections::{BTreeMap, HashMap};
use anyhow;
use cosmwasm_std::{Addr, HexBinary, Uint128};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug)]
pub struct State {
pub state: BTreeMap<Addr, Uint128>,
}
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct RawState {
pub state: BTreeMap<Addr, Uint128>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct RawEncryptedState {
pub ciphertext: HexBinary,
}
impl From<State> for RawState {
fn from(o: State) -> Self {
Self { state: o.state }
}
}
impl TryFrom<RawState> for State {
type Error = anyhow::Error;
fn try_from(o: RawState) -> Result<Self, anyhow::Error> {
Ok(Self { state: o.state })
}
}