Skip to content

Commit 1fde9e6

Browse files
authored
Merge pull request #86 from MostroP2P/feature-check-on-amount-and-premium
Fix #447 - orders with premium are rejected
2 parents eae744c + 7d4ca0f commit 1fde9e6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ pub enum CantDoReason {
5151
InvalidDisputeStatus,
5252
/// Invalid action
5353
InvalidAction,
54+
/// Pending order exists
55+
PendingOrderExists,
5456
}
5557

5658
#[derive(Debug, PartialEq, Eq)]

src/order.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@ impl SmallOrder {
457457
/// Check if the order has a zero amount and a premium or fiat amount
458458
pub fn check_zero_amount_with_premium(&self) -> Result<(), CantDoReason> {
459459
let premium = (self.premium != 0).then_some(self.premium);
460-
let fiat_amount = (self.fiat_amount != 0).then_some(self.fiat_amount);
460+
let sats_amount = (self.amount != 0).then_some(self.amount);
461461

462-
if premium.is_some() && fiat_amount.is_some() {
462+
if premium.is_some() && sats_amount.is_some() {
463463
return Err(CantDoReason::InvalidParameters);
464464
}
465465
Ok(())

0 commit comments

Comments
 (0)