From: Matt Corallo Date: Thu, 2 Dec 2021 19:43:51 +0000 (+0000) Subject: Update PeerTest for new trait-object-return call semantics X-Git-Tag: v0.0.103.1^2~5 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=cee3285cb8f4f409d7a748a40145bd652ed4f458;p=ldk-java Update PeerTest for new trait-object-return call semantics --- diff --git a/src/test/java/org/ldk/PeerTest.java b/src/test/java/org/ldk/PeerTest.java index 2aee0784..fe157b95 100644 --- a/src/test/java/org/ldk/PeerTest.java +++ b/src/test/java/org/ldk/PeerTest.java @@ -35,7 +35,6 @@ public class PeerTest { bindings.LDKBroadcasterInterface broad_trait; bindings.LDKLogger log_trait; bindings.LDKWatch watcher; - ArrayList results_to_free; Peer(byte seed) { this.log_trait = (String arg)-> System.out.println(seed + ": " + arg); @@ -45,7 +44,6 @@ public class PeerTest { this.broad_trait = tx -> { // We should broadcast }; - this.results_to_free = new ArrayList<>(); this.tx_broadcaster = bindings.LDKBroadcasterInterface_new(this.broad_trait); this.monitors = new HashMap<>(); this.watcher = new bindings.LDKWatch() { @@ -55,9 +53,7 @@ public class PeerTest { assert monitors.put(Arrays.toString(bindings.OutPoint_get_txid(funding_txo)), monitor) == null; } bindings.OutPoint_free(funding_txo); - long res = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok(); - results_to_free.add(res); - return res; + return bindings.CResult_NoneChannelMonitorUpdateErrZ_ok(); } @Override @@ -71,9 +67,7 @@ public class PeerTest { } bindings.OutPoint_free(funding_txo); bindings.ChannelMonitorUpdate_free(update); - long res = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok(); - results_to_free.add(res); - return res; + return bindings.CResult_NoneChannelMonitorUpdateErrZ_ok(); } @Override @@ -154,9 +148,6 @@ public class PeerTest { bindings.ChannelMonitor_free(mon); } } - for (Long res : results_to_free) { - bindings.CResult_NoneChannelMonitorUpdateErrZ_free(res); - } } }