Skip to content

Commit

Permalink
Fix bip353_address field attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgranhao committed Feb 5, 2025
1 parent aac8d2f commit ec87da4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/sdk-common/src/input_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,24 +238,24 @@ pub async fn parse(
let input = input.trim();

// Try to parse the destination as a bip353 address.
let (input, is_bip353) = match bip353_parse(input, &DNS_RESOLVER).await {
let (bip353_parsed_input, is_bip353) = match bip353_parse(input, &DNS_RESOLVER).await {
Some(value) => (value, true),
None => (input.to_string(), false),
};

if let Ok(input_type) = parse_core(&input).await {
if let Ok(input_type) = parse_core(&bip353_parsed_input).await {
let input_type = if is_bip353 {
match input_type {
#[cfg(feature = "liquid")]
InputType::Bolt12Offer { offer } => InputType::Bip353Address {
resolved_bip353: ResolvedBip353::Bolt12Offer {
bip353_address: input,
bip353_address: input.to_string(),
offer,
},
},
InputType::LnUrlPay { data } => InputType::Bip353Address {
resolved_bip353: ResolvedBip353::LnUrlPay {
bip353_address: input,
bip353_address: input.to_string(),
request_data: data,
},
},
Expand All @@ -269,7 +269,7 @@ pub async fn parse(
}

if let Some(external_input_parsers) = external_input_parsers {
return parse_external(&input, external_input_parsers).await;
return parse_external(input, external_input_parsers).await;
}

Err(anyhow!("Unrecognized input type"))
Expand Down

0 comments on commit ec87da4

Please sign in to comment.