fedimint_unknown_common/
config.rs

1use fedimint_core::core::ModuleKind;
2use fedimint_core::encoding::{Decodable, Encodable};
3use fedimint_core::plugin_types_trait_impl_config;
4use serde::{Deserialize, Serialize};
5
6use crate::UnknownCommonInit;
7
8/// Parameters necessary to generate this module's configuration
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct UnknownGenParams {
11    pub local: UnknownGenParamsLocal,
12    pub consensus: UnknownGenParamsConsensus,
13}
14
15/// Local parameters for config generation
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct UnknownGenParamsLocal;
18
19/// Consensus parameters for config generation
20#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct UnknownGenParamsConsensus;
22
23impl Default for UnknownGenParams {
24    fn default() -> Self {
25        Self {
26            local: UnknownGenParamsLocal,
27            consensus: UnknownGenParamsConsensus,
28        }
29    }
30}
31
32/// Contains all the configuration for the server
33#[derive(Clone, Debug, Serialize, Deserialize)]
34pub struct UnknownConfig {
35    pub private: UnknownConfigPrivate,
36    pub consensus: UnknownConfigConsensus,
37}
38
39/// Contains all the configuration for the client
40#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Encodable, Decodable, Hash)]
41pub struct UnknownClientConfig;
42
43/// Locally unencrypted config unique to each member
44#[derive(Clone, Debug, Serialize, Deserialize, Decodable, Encodable)]
45pub struct UnknownConfigLocal;
46
47/// Will be the same for every federation member
48#[derive(Clone, Debug, Serialize, Deserialize, Decodable, Encodable)]
49pub struct UnknownConfigConsensus;
50
51/// Will be encrypted and not shared such as private key material
52#[derive(Clone, Debug, Serialize, Deserialize)]
53pub struct UnknownConfigPrivate;
54
55// Wire together the configs for this module
56plugin_types_trait_impl_config!(
57    UnknownCommonInit,
58    UnknownGenParams,
59    UnknownGenParamsLocal,
60    UnknownGenParamsConsensus,
61    UnknownConfig,
62    UnknownConfigPrivate,
63    UnknownConfigConsensus,
64    UnknownClientConfig
65);