Skip to content

Commit

Permalink
convert fiat code to uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
grunch committed Mar 17, 2023
1 parent 1c666c5 commit 37be6d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ async fn main() -> Result<()> {
invoice,
}) => {
let mostro_key = XOnlyPublicKey::from_bech32(pubkey)?;

// Uppercase currency
let fiat_code = fiat_code.to_uppercase();
// Check if fiat currency selected is available on Yadio and eventually force user to set amount
// this is in the case of crypto <--> crypto offer for example
if *amount == 0 {
Expand All @@ -204,7 +205,7 @@ async fn main() -> Result<()> {
.await?
.json::<FiatNames>()
.await?
.contains_key(fiat_code);
.contains_key(&fiat_code);
if !fiat_list_check {
println!("{} is not present in the fiat market, please specify an amount with -a flag to fix the rate", fiat_code);
std::process::exit(0);
Expand All @@ -217,7 +218,7 @@ async fn main() -> Result<()> {
*kind,
types::Status::Pending,
*amount,
fiat_code.to_owned(),
fiat_code,
*fiat_amount,
payment_method.to_owned(),
*prime,
Expand Down

0 comments on commit 37be6d5

Please sign in to comment.