From 76184e0058d8f4c0dad1dbbbf0079e801fe331eb Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 24 Nov 2021 20:47:28 -0500 Subject: [PATCH] Add Signet support --- README.md | 2 +- src/cli.rs | 5 +++-- src/main.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) 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") -- 2.39.5