]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Update demo to latest upstream bindings
authorMatt Corallo <git@bluematt.me>
Thu, 15 Apr 2021 17:17:30 +0000 (13:17 -0400)
committerMatt Corallo <git@bluematt.me>
Thu, 15 Apr 2021 21:59:35 +0000 (17:59 -0400)
lightning-c-bindings/demo.c
lightning-c-bindings/demo.cpp

index d9508c59e6485aec84aa76cff0937c56deb32214..2e4d363f0310f484cc93d2127013978bdbc51222 100644 (file)
@@ -74,7 +74,7 @@ int main() {
        LDKUserConfig config = UserConfig_default();
        LDKThirtyTwoBytes chain_tip;
        memset(&chain_tip, 0, 32);
        LDKUserConfig config = UserConfig_default();
        LDKThirtyTwoBytes chain_tip;
        memset(&chain_tip, 0, 32);
-       LDKChainParameters chain = ChainParameters_new(net, chain_tip, 0);
+       LDKChainParameters chain = ChainParameters_new(net, BestBlock_new(chain_tip, 0));
        LDKChannelManager cm = ChannelManager_new(fee_est, mon, broadcast, logger, keys_source, config, chain);
 
        LDKCVec_ChannelDetailsZ channels = ChannelManager_list_channels(&cm);
        LDKChannelManager cm = ChannelManager_new(fee_est, mon, broadcast, logger, keys_source, config, chain);
 
        LDKCVec_ChannelDetailsZ channels = ChannelManager_list_channels(&cm);
index 222e29e69619efa8dae9ca88026574545e8f300f..e0827f6c726cb04ffa2fe3d04ae83e9c39835792 100644 (file)
@@ -137,7 +137,7 @@ struct NodeMonitors {
        void ConnectBlock(const uint8_t (*header)[80], uint32_t height, LDKCVec_C2Tuple_usizeTransactionZZ tx_data, LDKBroadcasterInterface broadcast, LDKFeeEstimator fee_est) {
                std::unique_lock<std::mutex> l(mut);
                for (auto& mon : mons) {
        void ConnectBlock(const uint8_t (*header)[80], uint32_t height, LDKCVec_C2Tuple_usizeTransactionZZ tx_data, LDKBroadcasterInterface broadcast, LDKFeeEstimator fee_est) {
                std::unique_lock<std::mutex> l(mut);
                for (auto& mon : mons) {
-                       LDK::CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ res = ChannelMonitor_block_connected(&mon.second, header, tx_data, height, broadcast, fee_est, *logger);
+                       LDK::CVec_TransactionOutputsZ res = ChannelMonitor_block_connected(&mon.second, header, tx_data, height, broadcast, fee_est, *logger);
                }
        }
 };
                }
        }
 };
@@ -361,7 +361,7 @@ int main() {
                LDK::KeysInterface keys_source1 = KeysManager_as_KeysInterface(&keys1);
                node_secret1 = keys_source1->get_node_secret(keys_source1->this_arg);
 
                LDK::KeysInterface keys_source1 = KeysManager_as_KeysInterface(&keys1);
                node_secret1 = keys_source1->get_node_secret(keys_source1->this_arg);
 
-               LDK::ChannelManager cm1 = ChannelManager_new(fee_est, mon1, broadcast, logger1, KeysManager_as_KeysInterface(&keys1), UserConfig_default(), ChainParameters_new(network, chain_tip, 0));
+               LDK::ChannelManager cm1 = ChannelManager_new(fee_est, mon1, broadcast, logger1, KeysManager_as_KeysInterface(&keys1), UserConfig_default(), ChainParameters_new(network, BestBlock_new(chain_tip, 0)));
 
                LDK::CVec_ChannelDetailsZ channels = ChannelManager_list_channels(&cm1);
                assert(channels->datalen == 0);
 
                LDK::CVec_ChannelDetailsZ channels = ChannelManager_list_channels(&cm1);
                assert(channels->datalen == 0);
@@ -388,7 +388,7 @@ int main() {
                LDK::UserConfig config2 = UserConfig_default();
                UserConfig_set_own_channel_config(&config2, std::move(handshake_config2));
 
                LDK::UserConfig config2 = UserConfig_default();
                UserConfig_set_own_channel_config(&config2, std::move(handshake_config2));
 
-               LDK::ChannelManager cm2 = ChannelManager_new(fee_est, mon2, broadcast, logger2, KeysManager_as_KeysInterface(&keys2), std::move(config2), ChainParameters_new(network, chain_tip, 0));
+               LDK::ChannelManager cm2 = ChannelManager_new(fee_est, mon2, broadcast, logger2, KeysManager_as_KeysInterface(&keys2), std::move(config2), ChainParameters_new(network, BestBlock_new(chain_tip, 0)));
 
                LDK::CVec_ChannelDetailsZ channels2 = ChannelManager_list_channels(&cm2);
                assert(channels2->datalen == 0);
 
                LDK::CVec_ChannelDetailsZ channels2 = ChannelManager_list_channels(&cm2);
                assert(channels2->datalen == 0);