fedimint_dummy_common/
config.rs

1use fedimint_core::core::ModuleKind;
2use fedimint_core::encoding::{Decodable, Encodable};
3use fedimint_core::{Amount, plugin_types_trait_impl_config};
4use serde::{Deserialize, Serialize};
5
6use crate::DummyCommonInit;
7
8/// Contains all the configuration for the server
9#[derive(Clone, Debug, Serialize, Deserialize)]
10pub struct DummyConfig {
11    pub private: DummyConfigPrivate,
12    pub consensus: DummyConfigConsensus,
13}
14
15/// Contains all the configuration for the client
16#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Encodable, Decodable, Hash)]
17pub struct DummyClientConfig {
18    /// Accessible to clients
19    pub tx_fee: Amount,
20}
21
22/// Locally unencrypted config unique to each member
23#[derive(Clone, Debug, Serialize, Deserialize, Decodable, Encodable)]
24pub struct DummyConfigLocal;
25
26/// Will be the same for every federation member
27#[derive(Clone, Debug, Serialize, Deserialize, Decodable, Encodable)]
28pub struct DummyConfigConsensus {
29    /// Will be the same for all peers
30    pub tx_fee: Amount,
31}
32
33/// Will be encrypted and not shared such as private key material
34#[derive(Clone, Debug, Serialize, Deserialize)]
35pub struct DummyConfigPrivate;
36
37// Wire together the configs for this module
38plugin_types_trait_impl_config!(
39    DummyCommonInit,
40    DummyConfig,
41    DummyConfigPrivate,
42    DummyConfigConsensus,
43    DummyClientConfig
44);