Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/.fiat.rs.un~
Binary file not shown.
22 changes: 16 additions & 6 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ impl std::error::Error for MostroError {}
impl fmt::Display for MostroError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
MostroError::ParsingInvoiceError => write!(f, "Incorrect invoice"),
MostroError::ParsingNumberError => write!(f, "Error parsing the number"),
MostroError::InvoiceExpiredError => write!(f, "Invoice has expired"),
MostroError::MinExpirationTimeError => write!(f, "Minimal expiration time on invoice"),
MostroError::MinAmountError => write!(f, "Minimal payment amount"),
MostroError::ParsingInvoiceError => {
write!(f, "Failed to parse Lightning invoice: invalid format or checksum")
}
MostroError::ParsingNumberError => {
write!(f, "Failed to parse numeric value: expected valid integer")
}
MostroError::InvoiceExpiredError => {
write!(f, "Lightning invoice has expired and cannot be used")
}
MostroError::MinExpirationTimeError => {
write!(f, "Invoice expiration time is below the minimum required duration")
}
MostroError::MinAmountError => {
write!(f, "Payment amount is below the minimum required value")
}
}
}
}
Expand All @@ -39,4 +49,4 @@ impl From<std::num::ParseIntError> for MostroError {
fn from(_: std::num::ParseIntError) -> Self {
MostroError::ParsingNumberError
}
}
}
10 changes: 10 additions & 0 deletions src/fiat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,16 @@ pub fn load_fiat_values() -> FiatList {
"emoji": "",
"name_plural": "Mauritian rupees"
},
"MWK": {
"symbol": "MWK",
"name": "Malawi Kwacha",
"symbol_native": "MWK",
"decimal_digits": 2,
"rounding": 0,
"code": "MWK",
"emoji": "",
"name_plural": "Malawian Kwacha"
},
"MXN": {
"symbol": "MX$",
"name": "Peso mexicano",
Expand Down
Loading