pub mod api;
pub mod errors;
use entropy_kvdb::kv_manager::value::{KvValue, PartyInfo};
use serde::{Deserialize, Serialize};
use subxt::ext::sp_runtime::AccountId32;
pub use self::errors::*;
#[cfg(test)]
pub(crate) mod tests;
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct UserInputPartyInfo {
pub key: AccountId32,
pub value: KvValue,
}
impl TryInto<ParsedUserInputPartyInfo> for UserInputPartyInfo {
type Error = UserErr;
fn try_into(self) -> Result<ParsedUserInputPartyInfo, Self::Error> {
let parsed_input = ParsedUserInputPartyInfo { key: self.key, value: self.value };
Ok(parsed_input)
}
}
#[derive(Debug, Deserialize, Clone, Serialize)]
pub struct ParsedUserInputPartyInfo {
pub key: AccountId32,
pub value: KvValue, }
impl TryInto<PartyInfo> for ParsedUserInputPartyInfo {
type Error = UserErr;
fn try_into(self) -> Result<PartyInfo, Self::Error> {
Err(UserErr::InputValidation("error"))
}
}