fix: relay fee in msats

Signed-off-by: Greg Heartsfield <scsibug@imap.cc>
This commit is contained in:
thesimplekid 2023-10-31 21:50:12 +00:00 committed by Greg Heartsfield
parent a7b169c0d3
commit 7650f5f4a3

View File

@ -4,7 +4,7 @@ use crate::config::Settings;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
pub const CARGO_PKG_VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION"); pub const CARGO_PKG_VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION");
pub const UNIT: &str = "sats"; pub const UNIT: &str = "msats";
/// Limitations of the relay as specified in NIP-111 /// Limitations of the relay as specified in NIP-111
/// (This nip isn't finalized so may change) /// (This nip isn't finalized so may change)
@ -45,7 +45,7 @@ pub struct RelayInfo {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub contact: Option<String>, pub contact: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub icon: Option<String>, pub icon: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub supported_nips: Option<Vec<i64>>, pub supported_nips: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@ -80,7 +80,7 @@ impl From<Settings> for RelayInfo {
let (payment_url, fees) = if p.enabled { let (payment_url, fees) = if p.enabled {
let admission_fee = if p.admission_cost > 0 { let admission_fee = if p.admission_cost > 0 {
Some(vec![Fee { Some(vec![Fee {
amount: p.admission_cost, amount: p.admission_cost * 1000,
unit: UNIT.to_string(), unit: UNIT.to_string(),
}]) }])
} else { } else {
@ -89,7 +89,7 @@ impl From<Settings> for RelayInfo {
let post_fee = if p.cost_per_event > 0 { let post_fee = if p.cost_per_event > 0 {
Some(vec![Fee { Some(vec![Fee {
amount: p.cost_per_event, amount: p.cost_per_event * 1000,
unit: UNIT.to_string(), unit: UNIT.to_string(),
}]) }])
} else { } else {