Update auto-generated bindings to include ln-transaction-sync
[ldk-c-bindings] / lightning-c-bindings / src / bitcoin / network.rs
index 52cb2ce68a26dbdf81cccc50702568a9aa449722..78565a1c19f30e25d7af30a2dd63d139b22629e0 100644 (file)
@@ -1,10 +1,17 @@
+//! A C-mapped version fo bitcoin::network::constants::Network
+
 use bitcoin::network::constants::Network as BitcoinNetwork;
 
 #[repr(C)]
+/// An enum representing the possible Bitcoin or test networks which we can run on
 pub enum Network {
+       /// The main Bitcoin blockchain.
        Bitcoin,
+       /// The testnet3 blockchain.
        Testnet,
+       /// A local test blockchain.
        Regtest,
+       /// A blockchain on which blocks are signed instead of mined.
        Signet,
 }
 
@@ -17,12 +24,13 @@ impl Network {
                        Network::Signet => BitcoinNetwork::Signet,
                }
        }
-       pub(crate) fn from_bitcoin(net: BitcoinNetwork) -> Self {
+       pub(crate) fn from_bitcoin(net: &BitcoinNetwork) -> Self {
                match net {
                        BitcoinNetwork::Bitcoin => Network::Bitcoin,
                        BitcoinNetwork::Testnet => Network::Testnet,
                        BitcoinNetwork::Regtest => Network::Regtest,
                        BitcoinNetwork::Signet => Network::Signet,
+                       _ => unreachable!(),
                }
        }
 }