Skip to content

Commit

Permalink
fix: lud21 test
Browse files Browse the repository at this point in the history
  • Loading branch information
lsunsi committed Jan 4, 2024
1 parent 0fb920f commit 629953b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/lud21.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@ async fn test() {
symbol: String::from("R$"),
decimals: 2,
multiplier: 314.15,
convertible: true,
convertible: Some(lnurlkit::pay::CurrencyConvertible {
min: 1,
max: 3
}),
},
lnurlkit::pay::Currency {
code: String::from("USD"),
name: String::from("Dólar"),
symbol: String::from("$"),
decimals: 3,
multiplier: 123.321,
convertible: false,
convertible: None,
},
]),
payer: None,
Expand Down Expand Up @@ -82,14 +85,17 @@ async fn test() {
assert_eq!(currencies[0].symbol, "R$");
assert_eq!(currencies[0].decimals, 2);
assert!((currencies[0].multiplier - 314.15).abs() < f64::EPSILON);
assert!(currencies[0].convertible);

let convertible = currencies[0].convertible.as_ref().unwrap();
assert_eq!(convertible.min, 1);
assert_eq!(convertible.max, 3);

assert_eq!(currencies[1].code, "USD");
assert_eq!(currencies[1].name, "Dólar");
assert_eq!(currencies[1].symbol, "$");
assert_eq!(currencies[1].decimals, 3);
assert!((currencies[1].multiplier - 123.321).abs() < f64::EPSILON);
assert!(!currencies[1].convertible);
assert!(currencies[1].convertible.is_none());

let invoice = pr
.invoice(
Expand Down

0 comments on commit 629953b

Please sign in to comment.