Skip to content

Commit 27e6786

Browse files
authored
Enable Signet network (#60)
Enable Signet network in the code that is used in the remote signer for Sparknode. This will allow testing lightning payments to Spark using Signet. Towards LPT-225
1 parent 8f0afa6 commit 27e6786

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

lightspark-remote-signing/src/signer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub enum Network {
2727
Bitcoin,
2828
Testnet,
2929
Regtest,
30+
Signet,
3031
}
3132

3233
impl fmt::Display for Error {
@@ -119,6 +120,7 @@ impl LightsparkSigner {
119120
Network::Bitcoin => bitcoin::Network::Bitcoin,
120121
Network::Testnet => bitcoin::Network::Testnet,
121122
Network::Regtest => bitcoin::Network::Regtest,
123+
Network::Signet => bitcoin::Network::Signet,
122124
};
123125
let master_private_key = ExtendedPrivKey::new_master(network, seed.as_bytes().as_slice())
124126
.map_err(|_| Error::KeyDerivationError)?;

lightspark-remote-signing/src/signing_requests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ fn bitcoin_network_from_webhook_event(event: &WebhookEvent) -> Result<BitcoinNet
323323
"MAINNET" => Ok(BitcoinNetwork::Mainnet),
324324
"TESTNET" => Ok(BitcoinNetwork::Testnet),
325325
"REGTEST" => Ok(BitcoinNetwork::Regtest),
326+
"SIGNET" => Ok(BitcoinNetwork::Signet),
326327
_ => Err(Error::WebhookEventDataMissing),
327328
}
328329
}

lightspark/src/objects/permission.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ pub enum Permission {
3636
#[serde(rename = "REGTEST_MANAGE")]
3737
RegtestManage,
3838

39+
#[serde(rename = "SIGNET_VIEW")]
40+
SignetView,
41+
42+
#[serde(rename = "SIGNET_TRANSACT")]
43+
SignetTransact,
44+
45+
#[serde(rename = "SIGNET_MANAGE")]
46+
SignetManage,
47+
3948
#[serde(rename = "USER_VIEW")]
4049
UserView,
4150

@@ -68,6 +77,9 @@ impl fmt::Display for Permission {
6877
Self::RegtestView => write!(f, "REGTEST_VIEW"),
6978
Self::RegtestTransact => write!(f, "REGTEST_TRANSACT"),
7079
Self::RegtestManage => write!(f, "REGTEST_MANAGE"),
80+
Self::SignetView => write!(f, "SIGNET_VIEW"),
81+
Self::SignetTransact => write!(f, "SIGNET_TRANSACT"),
82+
Self::SignetManage => write!(f, "SIGNET_MANAGE"),
7183
Self::UserView => write!(f, "USER_VIEW"),
7284
Self::UserManage => write!(f, "USER_MANAGE"),
7385
Self::AccountView => write!(f, "ACCOUNT_VIEW"),

0 commit comments

Comments
 (0)