fedimint_unknown_common/
lib.rs#![deny(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]
use std::fmt;
use config::UnknownClientConfig;
use fedimint_core::core::{Decoder, ModuleInstanceId, ModuleKind};
use fedimint_core::encoding::{Decodable, Encodable};
use fedimint_core::module::{CommonModuleInit, ModuleCommon, ModuleConsensusVersion};
use fedimint_core::plugin_types_trait_impl_common;
use serde::{Deserialize, Serialize};
use thiserror::Error;
pub mod config;
pub const KIND: ModuleKind = ModuleKind::from_static_str("unknown");
pub const MODULE_CONSENSUS_VERSION: ModuleConsensusVersion = ModuleConsensusVersion::new(0, 0);
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize, Encodable, Decodable)]
pub struct UnknownConsensusItem;
#[derive(Debug, Clone, Eq, PartialEq, Hash, Deserialize, Serialize, Encodable, Decodable)]
pub struct UnknownInput;
#[derive(Debug, Clone, Eq, PartialEq, Hash, Deserialize, Serialize, Encodable, Decodable)]
pub struct UnknownOutput;
#[derive(Debug, Clone, Eq, PartialEq, Hash, Deserialize, Serialize, Encodable, Decodable)]
pub enum UnknownOutputOutcome {}
#[derive(Debug, Clone, Eq, PartialEq, Hash, Error, Encodable, Decodable)]
pub enum UnknownInputError {}
#[derive(Debug, Clone, Eq, PartialEq, Hash, Error, Encodable, Decodable)]
pub enum UnknownOutputError {}
pub struct UnknownModuleTypes;
plugin_types_trait_impl_common!(
KIND,
UnknownModuleTypes,
UnknownClientConfig,
UnknownInput,
UnknownOutput,
UnknownOutputOutcome,
UnknownConsensusItem,
UnknownInputError,
UnknownOutputError
);
#[derive(Debug)]
pub struct UnknownCommonInit;
impl CommonModuleInit for UnknownCommonInit {
const CONSENSUS_VERSION: ModuleConsensusVersion = MODULE_CONSENSUS_VERSION;
const KIND: ModuleKind = KIND;
type ClientConfig = UnknownClientConfig;
fn decoder() -> Decoder {
UnknownModuleTypes::decoder_builder().build()
}
}
impl fmt::Display for UnknownClientConfig {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "UnknownClientConfig")
}
}
impl fmt::Display for UnknownInput {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "UnknownInput")
}
}
impl fmt::Display for UnknownOutput {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "UnknownOutput")
}
}
impl fmt::Display for UnknownOutputOutcome {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "UnknownOutputOutcome")
}
}
impl fmt::Display for UnknownConsensusItem {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "UnknownConsensusItem")
}
}