Skip to content

Commit

Permalink
Remove parsing for unnecessary federation bool
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyGiorgio committed May 13, 2024
1 parent 43599f4 commit fb7654e
Showing 1 changed file with 0 additions and 58 deletions.
58 changes: 0 additions & 58 deletions mutiny-core/src/federation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,10 @@ pub struct FederationIdentity {
pub max_balance_msats: Option<u32>,
pub max_invoice_msats: Option<u32>,
pub meta_external_url: Option<String>,
pub onchain_deposits_disabled: Option<bool>,
pub preview_message: Option<String>,
pub public: Option<bool>,
pub tos_url: Option<String>,
pub popup_end_timestamp: Option<u32>,
pub popup_countdown_message: Option<String>,
pub invite_codes_disabled: Option<bool>,
pub stability_pool_disabled: Option<bool>,
pub social_recovery_disabled: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
Expand All @@ -199,15 +194,10 @@ pub struct FederationMeta {
pub max_balance_msats: Option<String>,
pub max_invoice_msats: Option<String>,
pub meta_external_url: Option<String>,
pub onchain_deposits_disabled: Option<String>,
pub preview_message: Option<String>,
pub public: Option<String>,
pub tos_url: Option<String>,
pub popup_end_timestamp: Option<String>,
pub popup_countdown_message: Option<String>,
pub invite_codes_disabled: Option<String>,
pub stability_pool_disabled: Option<String>,
pub social_recovery_disabled: Option<String>,
}

#[derive(Default, Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
Expand Down Expand Up @@ -969,28 +959,10 @@ pub(crate) async fn get_federation_identity(
.and_then(|c| c.max_invoice_msats.clone().map(|v| v.parse().unwrap_or(0))),
),
meta_external_url, // Already set...
onchain_deposits_disabled: merge_values(
fedimint_client
.get_meta("onchain_deposits_disabled")
.map(|v| v.parse().unwrap_or(false)),
config.as_ref().and_then(|c| {
c.onchain_deposits_disabled
.clone()
.map(|v| v.parse().unwrap_or(false))
}),
),
preview_message: merge_values(
fedimint_client.get_meta("preview_message"),
config.as_ref().and_then(|c| c.preview_message.clone()),
),
public: merge_values(
fedimint_client
.get_meta("public")
.map(|v| v.parse().unwrap_or(false)),
config
.as_ref()
.and_then(|c| c.public.clone().map(|v| v.parse().unwrap_or(false))),
),
tos_url: merge_values(
fedimint_client.get_meta("tos_url"),
config.as_ref().and_then(|c| c.tos_url.clone()),
Expand All @@ -1013,36 +985,6 @@ pub(crate) async fn get_federation_identity(
.as_ref()
.and_then(|c| c.popup_countdown_message.clone()),
),
invite_codes_disabled: merge_values(
fedimint_client
.get_meta("invite_codes_disabled")
.map(|v| v.parse().unwrap_or(false)),
config.as_ref().and_then(|c| {
c.invite_codes_disabled
.clone()
.map(|v| v.parse().unwrap_or(false))
}),
),
stability_pool_disabled: merge_values(
fedimint_client
.get_meta("stability_pool_disabled")
.map(|v| v.parse().unwrap_or(false)),
config.as_ref().and_then(|c| {
c.stability_pool_disabled
.clone()
.map(|v| v.parse().unwrap_or(false))
}),
),
social_recovery_disabled: merge_values(
fedimint_client
.get_meta("social_recovery_disabled")
.map(|v| v.parse().unwrap_or(false)),
config.as_ref().and_then(|c| {
c.social_recovery_disabled
.clone()
.map(|v| v.parse().unwrap_or(false))
}),
),
}
}

Expand Down

0 comments on commit fb7654e

Please sign in to comment.