From: Matt Corallo Date: Sat, 24 Oct 2020 23:55:57 +0000 (-0400) Subject: Fix tests for new API X-Git-Tag: v0.0.1~81 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=65c7ed08a3aee0f2b47e364e0e1394a2c27eb029;p=ldk-java Fix tests for new API --- diff --git a/src/test/java/org/ldk/HumanObjectPeerTest.java b/src/test/java/org/ldk/HumanObjectPeerTest.java index fd25481c..475a2893 100644 --- a/src/test/java/org/ldk/HumanObjectPeerTest.java +++ b/src/test/java/org/ldk/HumanObjectPeerTest.java @@ -20,7 +20,6 @@ class HumanObjectPeerTestInstance { final Logger logger; final FeeEstimator fee_estimator; final BroadcasterInterface tx_broadcaster; - final KeysManager keys; final KeysInterface keys_interface; final ChannelManager chan_manager; final EventsProvider chan_manager_events; @@ -31,13 +30,13 @@ class HumanObjectPeerTestInstance { final LinkedList broadcast_set = new LinkedList<>(); Peer(byte seed) { - logger = new Logger((String arg) -> System.out.println(seed + ": " + arg)); - fee_estimator = new FeeEstimator((confirmation_target -> 253)); - tx_broadcaster = new BroadcasterInterface(tx -> { + logger = Logger.new_impl((String arg) -> System.out.println(seed + ": " + arg)); + fee_estimator = FeeEstimator.new_impl((confirmation_target -> 253)); + tx_broadcaster = BroadcasterInterface.new_impl(tx -> { broadcast_set.add(tx); }); this.monitors = new HashMap<>(); - Watch chain_monitor = new Watch(new Watch.WatchInterface() { + Watch chain_monitor = Watch.new_impl(new Watch.WatchInterface() { public Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor) { synchronized (monitors) { assert monitors.put(Arrays.toString(funding_txo.get_txid()), monitor) == null; @@ -71,9 +70,9 @@ class HumanObjectPeerTestInstance { for (byte i = 0; i < 32; i++) { key_seed[i] = (byte) (i ^ seed); } - this.keys = KeysManager.constructor_new(key_seed, LDKNetwork.LDKNetwork_Bitcoin, System.currentTimeMillis() / 1000, (int) (System.currentTimeMillis() * 1000) & 0xffffffff); + KeysManager keys = KeysManager.constructor_new(key_seed, LDKNetwork.LDKNetwork_Bitcoin, System.currentTimeMillis() / 1000, (int) (System.currentTimeMillis() * 1000) & 0xffffffff); this.keys_interface = keys.as_KeysInterface(); - this.chan_manager = ChannelManager.constructor_new(LDKNetwork.LDKNetwork_Bitcoin, new FeeEstimator(confirmation_target -> 0), chain_monitor, tx_broadcaster, logger, keys.as_KeysInterface(), UserConfig.constructor_default(), 1); + this.chan_manager = ChannelManager.constructor_new(LDKNetwork.LDKNetwork_Bitcoin, FeeEstimator.new_impl(confirmation_target -> 0), chain_monitor, tx_broadcaster, logger, this.keys_interface, UserConfig.constructor_default(), 1); this.node_id = chan_manager.get_our_node_id(); this.chan_manager_events = chan_manager.as_EventsProvider(); this.router = NetGraphMsgHandler.constructor_new(null, logger);