Add all the manually-generated bits for the c-bindings crate
[rust-lightning] / lightning-c-bindings / src / bitcoin / network.rs
diff --git a/lightning-c-bindings/src/bitcoin/network.rs b/lightning-c-bindings/src/bitcoin/network.rs
new file mode 100644 (file)
index 0000000..13799c0
--- /dev/null
@@ -0,0 +1,18 @@
+use bitcoin::network::constants::Network as BitcoinNetwork;
+
+#[repr(C)]
+pub enum Network {
+       Bitcoin,
+       Testnet,
+       Regtest,
+}
+
+impl Network {
+       pub(crate) fn into_bitcoin(&self) -> BitcoinNetwork {
+               match self {
+                       Network::Bitcoin => BitcoinNetwork::Bitcoin,
+                       Network::Testnet => BitcoinNetwork::Testnet,
+                       Network::Regtest => BitcoinNetwork::Regtest,
+               }
+       }
+}