Skip to content

Commit 6749bc6

Browse files
authored
Merge pull request #4148 from tnull/2025-10-testnet4-support
Add support for `Testnet4`
2 parents 24e89f0 + 743f43f commit 6749bc6

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ lightning-liquidity = { path = "../lightning-liquidity" }
2424
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync" }
2525
lightning-persister = { path = "../lightning-persister", features = ["tokio"]}
2626
bech32 = "0.11.0"
27-
bitcoin = { version = "0.32.2", features = ["secp-lowmemory"] }
27+
bitcoin = { version = "0.32.4", features = ["secp-lowmemory"] }
2828
tokio = { version = "~1.35", default-features = false, features = ["rt-multi-thread"] }
2929

3030
afl = { version = "0.12", optional = true }

lightning-invoice/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ std = []
2222
bech32 = { version = "0.11.0", default-features = false }
2323
lightning-types = { version = "0.3.0", path = "../lightning-types", default-features = false }
2424
serde = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
25-
bitcoin = { version = "0.32.2", default-features = false, features = ["secp-recovery"] }
25+
bitcoin = { version = "0.32.4", default-features = false, features = ["secp-recovery"] }
2626

2727
[dev-dependencies]
2828
serde_json = { version = "1"}

lightning-invoice/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ pub enum Currency {
438438
Bitcoin,
439439

440440
/// Bitcoin testnet
441+
///
442+
/// Note this will also be used for invoices on [`Network::Testnet4`].
441443
BitcoinTestnet,
442444

443445
/// Bitcoin regtest
@@ -455,12 +457,9 @@ impl From<Network> for Currency {
455457
match network {
456458
Network::Bitcoin => Currency::Bitcoin,
457459
Network::Testnet => Currency::BitcoinTestnet,
460+
Network::Testnet4 => Currency::BitcoinTestnet,
458461
Network::Regtest => Currency::Regtest,
459462
Network::Signet => Currency::Signet,
460-
_ => {
461-
debug_assert!(false, "Need to handle new rust-bitcoin network type");
462-
Currency::Regtest
463-
},
464463
}
465464
}
466465
}
@@ -1625,6 +1624,9 @@ impl Bolt11Invoice {
16251624

16261625
/// Returns the network for which the invoice was issued
16271626
///
1627+
/// **Caution**: On Testnet4, this method will return [`Network::Testnet`]` rather than
1628+
/// [`Network::Testnet4`].
1629+
///
16281630
/// This is not exported to bindings users, see [`Self::currency`] instead.
16291631
pub fn network(&self) -> Network {
16301632
self.signed_invoice.currency().into()

lightning/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ lightning-invoice = { version = "0.34.0", path = "../lightning-invoice", default
3939
lightning-macros = { version = "0.2", path = "../lightning-macros" }
4040

4141
bech32 = { version = "0.11.0", default-features = false }
42-
bitcoin = { version = "0.32.2", default-features = false, features = ["secp-recovery"] }
42+
bitcoin = { version = "0.32.4", default-features = false, features = ["secp-recovery"] }
4343

4444
dnssec-prover = { version = "0.6", default-features = false }
4545
hashbrown = { version = "0.13", default-features = false }
@@ -58,7 +58,7 @@ lightning-macros = { path = "../lightning-macros" }
5858
parking_lot = { version = "0.12", default-features = false }
5959

6060
[dev-dependencies.bitcoin]
61-
version = "0.32.2"
61+
version = "0.32.4"
6262
default-features = false
6363
features = ["bitcoinconsensus", "secp-recovery"]
6464

0 commit comments

Comments
 (0)