Skip to content

Commit

Permalink
Merge pull request #546 from breez/ok300-clonable-structs
Browse files Browse the repository at this point in the history
Derive Clone trait for some fiat currency structs
  • Loading branch information
ok300 authored Oct 23, 2023
2 parents 30164e1 + 15ca790 commit 3486c95
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libs/sdk-core/src/fiat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
use tonic::Request;

/// Settings for the symbol representation of a currency
#[derive(Serialize, Deserialize, Debug)]
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct Symbol {
pub grapheme: Option<String>,
pub template: Option<String>,
Expand All @@ -17,22 +17,22 @@ pub struct Symbol {
}

/// Locale-specific settings for the representation of a currency
#[derive(Serialize, Deserialize, Debug)]
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct LocaleOverrides {
pub locale: String,
pub spacing: Option<u32>,
pub symbol: Symbol,
}

/// Localized name of a currency
#[derive(Serialize, Deserialize, Debug)]
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct LocalizedName {
pub locale: String,
pub name: String,
}

/// Details about a supported currency in the fiat rate feed
#[derive(Serialize, Deserialize, Debug)]
#[derive(Clone, Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct CurrencyInfo {
pub name: String,
Expand All @@ -45,14 +45,14 @@ pub struct CurrencyInfo {
}

/// Wrapper around the [CurrencyInfo] of a fiat currency
#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct FiatCurrency {
pub id: String,
pub info: CurrencyInfo,
}

/// Denominator in an exchange rate
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Rate {
pub coin: String,
pub value: f64,
Expand Down

0 comments on commit 3486c95

Please sign in to comment.