From 40fa0a72119f48a8ee0dca89325c2cd529c89b76 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 2 Oct 2020 16:55:05 -0400 Subject: [PATCH] Update test for new bindings --- src/test/java/org/ldk/PeerTest.java | 44 ++++------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/src/test/java/org/ldk/PeerTest.java b/src/test/java/org/ldk/PeerTest.java index 17d68b72..ce5024c5 100644 --- a/src/test/java/org/ldk/PeerTest.java +++ b/src/test/java/org/ldk/PeerTest.java @@ -20,19 +20,19 @@ public class PeerTest { // We should broadcast } }); - long chain_monitor = bindings.LDKManyChannelMonitor_new(new bindings.LDKManyChannelMonitor() { + long chain_monitor = bindings.LDKWatch_new(new bindings.LDKWatch() { @Override - public long add_monitor(long funding_txo, long monitor) { + public long watch_channel(long funding_txo, long monitor) { return 0; } @Override - public long update_monitor(long funding_txo, long monitor) { + public long update_channel(long funding_txo, long update) { return 0; } @Override - public long get_and_clear_pending_monitor_events() { + public long release_pending_monitor_events() { return 0; } }); @@ -44,38 +44,7 @@ public class PeerTest { long chan_manager = bindings.ChannelManager_new(bindings.LDKNetwork.LDKNetwork_Bitcoin, fee_estimator, chain_monitor, tx_broadcaster, logger, keys_interface, config, 1); long chan_handler = bindings.ChannelManager_as_ChannelMessageHandler(chan_manager); - long chain_watch = bindings.LDKChainWatchInterface_new(new bindings.LDKChainWatchInterface() { - @Override - public void install_watch_tx(byte[] txid, long script_pub_key) { - - } - - @Override - public void install_watch_outpoint(long outpoint, long out_script) { - - } - - @Override - public void watch_all_txn() { - - } - - @Override - public long get_chain_utxo(long genesis_hash, long unspent_tx_output_identifier) { - return 0; - } - - @Override - public long filter_block(long block) { - return 0; - } - - @Override - public long reentered() { - return 0; - } - }); - long router = bindings.NetGraphMsgHandler_new(chain_watch, logger); + long router = bindings.NetGraphMsgHandler_new(0, logger); long route_handler = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(router); long message_handler = bindings.MessageHandler_new(chan_handler, route_handler); long our_node_secret = bindings.LDKSecretKey_new(); //TODO: Need LDKSecretKey constructor @@ -88,12 +57,11 @@ public class PeerTest { bindings.Logger_free(logger); bindings.FeeEstimator_free(fee_estimator); bindings.BroadcasterInterface_free(tx_broadcaster); - bindings.ManyChannelMonitor_free(chain_monitor); + bindings.Watch_free(chain_monitor); bindings.KeysManager_free(keys); bindings.KeysInterface_free(keys_interface); bindings.ChannelManager_free(chan_manager); bindings.ChannelMessageHandler_free(chan_handler); - bindings.ChainWatchInterface_free(chain_watch); bindings.NetGraphMsgHandler_free(router); bindings.RoutingMessageHandler_free(route_handler); //bindings.MessageHandler_free(message_handler); -- 2.39.5