Skip to content

Commit 0fdf0cf

Browse files
committed
Switch to LDK's HumanReadableName instead of our own
Previously I was hoping we could swap the dependency order between LDK and `bitcoin-payment-instructions`, but that turned out to be untennable, so instead we should reuse the LDK `HumanReadableName`.
1 parent d6ef87c commit 0fdf0cf

File tree

6 files changed

+8
-95
lines changed

6 files changed

+8
-95
lines changed

fuzz/src/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
use bitcoin::Network;
1111

1212
use bitcoin_payment_instructions::amount::Amount;
13-
use bitcoin_payment_instructions::hrn::HumanReadableName;
1413
use bitcoin_payment_instructions::hrn_resolution::{
15-
DummyHrnResolver, HrnResolution, HrnResolutionFuture, HrnResolver, LNURLResolutionFuture,
14+
DummyHrnResolver, HrnResolution, HrnResolutionFuture, HrnResolver, HumanReadableName,
15+
LNURLResolutionFuture,
1616
};
1717
use bitcoin_payment_instructions::PaymentInstructions;
1818

src/dns_resolver.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ use dnssec_prover::rr::Name;
99

1010
use crate::amount::Amount;
1111
use crate::dnssec_utils::resolve_proof;
12-
use crate::hrn::HumanReadableName;
1312
use crate::hrn_resolution::{
14-
HrnResolution, HrnResolutionFuture, HrnResolver, LNURLResolutionFuture,
13+
HrnResolution, HrnResolutionFuture, HrnResolver, HumanReadableName, LNURLResolutionFuture,
1514
};
1615

1716
/// An [`HrnResolver`] which resolves BIP 353 Human Readable Names to payment instructions using a
@@ -59,7 +58,7 @@ mod tests {
5958
use crate::*;
6059

6160
#[tokio::test]
62-
async fn test_http_hrn_resolver() {
61+
async fn test_dns_hrn_resolver() {
6362
let resolver = DNSHrnResolver(SocketAddr::from_str("8.8.8.8:53").unwrap());
6463
let instructions = PaymentInstructions::parse(
6564
"send.some@satsto.me",

src/hrn.rs

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/hrn_resolution.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
//! associated types in this module.
88
99
use crate::amount::Amount;
10-
use crate::hrn::HumanReadableName;
1110

1211
use lightning_invoice::Bolt11Invoice;
1312

13+
pub use lightning::onion_message::dns_resolution::HumanReadableName;
14+
1415
use core::future::Future;
1516
use core::pin::Pin;
1617

src/http_resolver.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ use lightning_invoice::{Bolt11Invoice, Bolt11InvoiceDescriptionRef};
1717

1818
use crate::amount::Amount;
1919
use crate::dnssec_utils::resolve_proof;
20-
use crate::hrn::HumanReadableName;
2120
use crate::hrn_resolution::{
22-
HrnResolution, HrnResolutionFuture, HrnResolver, LNURLResolutionFuture,
21+
HrnResolution, HrnResolutionFuture, HrnResolver, HumanReadableName, LNURLResolutionFuture,
2322
};
2423

2524
const DOH_ENDPOINT: &'static str = "https://dns.google/dns-query?dns=";

src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,8 @@ pub mod receive;
6363

6464
pub mod hrn_resolution;
6565

66-
pub mod hrn;
67-
6866
use amount::Amount;
69-
use hrn::HumanReadableName;
70-
use hrn_resolution::{HrnResolution, HrnResolver};
67+
use hrn_resolution::{HrnResolution, HrnResolver, HumanReadableName};
7168

7269
/// A method which can be used to make a payment
7370
#[derive(Clone, Debug, PartialEq, Eq)]

0 commit comments

Comments
 (0)