From 6ebd118e3d21731343867cb3381c7b11b6413146 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Wed, 27 Mar 2024 22:03:22 +0100 Subject: [PATCH] refactor: rename maximum -> max --- src/api/server/convert.rs | 4 ++-- src/profile/entity.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/server/convert.rs b/src/api/server/convert.rs index 6703890b..2b900633 100644 --- a/src/api/server/convert.rs +++ b/src/api/server/convert.rs @@ -38,7 +38,7 @@ impl From for proto::SpendingPolicy { .into_iter() .map(|addr| addr.to_string()) .collect(), - max_payout_sats: sp.maximum_payout.map(u64::from), + max_payout_sats: sp.max_payout.map(u64::from), } } } @@ -57,7 +57,7 @@ impl TryFrom<(proto::SpendingPolicy, bitcoin::Network)> for SpendingPolicy { } Ok(Self { allowed_payout_addresses, - maximum_payout: sp.max_payout_sats.map(Satoshis::from), + max_payout: sp.max_payout_sats.map(Satoshis::from), }) } } diff --git a/src/profile/entity.rs b/src/profile/entity.rs index da30f03f..acd26bee 100644 --- a/src/profile/entity.rs +++ b/src/profile/entity.rs @@ -63,7 +63,7 @@ impl Profile { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct SpendingPolicy { pub allowed_payout_addresses: Vec
, - pub maximum_payout: Option, + pub max_payout: Option, } impl SpendingPolicy { @@ -73,7 +73,7 @@ impl SpendingPolicy { } fn is_amount_allowed(&self, amount: Satoshis) -> bool { - self.maximum_payout.map(|max| amount <= max).unwrap_or(true) + self.max_payout.map(|max| amount <= max).unwrap_or(true) } }