Skip to content

Commit c49c982

Browse files
committed
Add support for Testnet4
We simply add support for `bitcoin::Network::Testnet4`, which was added with release v0.32.4, which we hence deem the new minimal requirement for `lightning` and `lightning-invoice`. As other Lightning implementations seem to simply map `Testnet4` coins to be `Testnet` (also reusing the `tb` prefix), we here follow their lead and choose not to introduce a separate `Currecy` variant, even though that could lead to checks failing if someone validated the returned `fallback_addresses` for the given `Network`.
1 parent 6d4897c commit c49c982

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-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: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,9 @@ impl From<Network> for Currency {
455455
match network {
456456
Network::Bitcoin => Currency::Bitcoin,
457457
Network::Testnet => Currency::BitcoinTestnet,
458+
Network::Testnet4 => Currency::BitcoinTestnet,
458459
Network::Regtest => Currency::Regtest,
459460
Network::Signet => Currency::Signet,
460-
_ => {
461-
debug_assert!(false, "Need to handle new rust-bitcoin network type");
462-
Currency::Regtest
463-
},
464461
}
465462
}
466463
}

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)