From: Carl Dong Date: Thu, 25 Nov 2021 01:47:28 +0000 (-0500) Subject: Add Signet support X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=76184e0058d8f4c0dad1dbbbf0079e801fe331eb;p=ldk-sample Add Signet support --- diff --git a/README.md b/README.md index 2da36cb..d409800 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ cargo run :@: Result { let network: Network = match env::args().skip(arg_idx).next().as_ref().map(String::as_str) { Some("testnet") => Network::Testnet, Some("regtest") => Network::Regtest, + Some("signet") => Network::Signet, Some(net) => { - panic!("Unsupported network provided. Options are: `regtest`, `testnet`. Got {}", net); + panic!("Unsupported network provided. Options are: `regtest`, `testnet`, and `signet`. Got {}", net); } None => Network::Testnet, }; @@ -669,7 +670,7 @@ fn get_invoice( Network::Bitcoin => Currency::Bitcoin, Network::Testnet => Currency::BitcoinTestnet, Network::Regtest => Currency::Regtest, - Network::Signet => panic!("Signet unsupported"), + Network::Signet => Currency::Signet, }; let invoice = match utils::create_invoice_from_channelmanager( &channel_manager, diff --git a/src/main.rs b/src/main.rs index 421069b..389ff05 100644 --- a/src/main.rs +++ b/src/main.rs @@ -128,7 +128,7 @@ async fn handle_ldk_events( Network::Bitcoin => bitcoin_bech32::constants::Network::Bitcoin, Network::Testnet => bitcoin_bech32::constants::Network::Testnet, Network::Regtest => bitcoin_bech32::constants::Network::Regtest, - Network::Signet => panic!("Signet unsupported"), + Network::Signet => bitcoin_bech32::constants::Network::Signet, }, ) .expect("Lightning funding tx should always be to a SegWit output")