]> git.bitcoin.ninja Git - ldk-java/commitdiff
[TS] Update typescript tests to latest upstream API
authorMatt Corallo <git@bluematt.me>
Fri, 30 Sep 2022 01:05:59 +0000 (01:05 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 3 Oct 2022 21:39:09 +0000 (21:39 +0000)
node-net/test/test.mts
ts/test/tests.mts

index 8d493e4dba74667d7acc76220d446f2194166fdf..86b6b3a2af9f1871fc5bfe6329da68f647fa0a9a 100644 (file)
@@ -25,8 +25,9 @@ const rng_seed = new Uint8Array(32);
 const routing_handler = ldk.IgnoringMessageHandler.constructor_new().as_RoutingMessageHandler();
 const chan_handler = ldk.ErroringMessageHandler.constructor_new().as_ChannelMessageHandler();
 const cust_handler = ldk.IgnoringMessageHandler.constructor_new().as_CustomMessageHandler();
+const onion_handler = ldk.IgnoringMessageHandler.constructor_new().as_OnionMessageHandler();
 
-const a_pm = ldk.PeerManager.constructor_new(chan_handler, routing_handler, node_a_secret, rng_seed, logger_a, cust_handler);
+const a_pm = ldk.PeerManager.constructor_new(chan_handler, routing_handler, onion_handler, node_a_secret, 0xdeadbeefn, rng_seed, logger_a, cust_handler);
 const a_net_handler = new node_net.NodeLDKNet(a_pm);
 var port = 10000;
 for (; port < 11000; port++) {
@@ -37,7 +38,7 @@ for (; port < 11000; port++) {
        } catch(_) {}
 }
 
-const b_pm = ldk.PeerManager.constructor_new(chan_handler, routing_handler, node_b_secret, rng_seed, logger_b, cust_handler);
+const b_pm = ldk.PeerManager.constructor_new(chan_handler, routing_handler, onion_handler, node_b_secret, 0xdeadbeefn, rng_seed, logger_b, cust_handler);
 const b_net_handler = new node_net.NodeLDKNet(b_pm);
 await b_net_handler.connect_peer("127.0.0.1", port, node_a_pk);
 
index a8edeaccc4f0592494bf3ef258634c67da2a4c22..0b1b3ee0317cbe617b2de49ebca59e6cc5153184 100644 (file)
@@ -212,8 +212,8 @@ tests.push(async () => {
        const b = get_chanman();
 
        const ignorer = ldk.IgnoringMessageHandler.constructor_new();
-       const pm_a = ldk.PeerManager.constructor_new(a.chan_man.as_ChannelMessageHandler(), ignorer.as_RoutingMessageHandler(), a.node_secret, a.node_secret, a.logger, ignorer.as_CustomMessageHandler());
-       const pm_b = ldk.PeerManager.constructor_new(b.chan_man.as_ChannelMessageHandler(), ignorer.as_RoutingMessageHandler(), b.node_secret, b.node_secret, b.logger, ignorer.as_CustomMessageHandler());
+       const pm_a = ldk.PeerManager.constructor_new(a.chan_man.as_ChannelMessageHandler(), ignorer.as_RoutingMessageHandler(), ignorer.as_OnionMessageHandler(), a.node_secret, 0xdeadbeefn, a.node_secret, a.logger, ignorer.as_CustomMessageHandler());
+       const pm_b = ldk.PeerManager.constructor_new(b.chan_man.as_ChannelMessageHandler(), ignorer.as_RoutingMessageHandler(), ignorer.as_OnionMessageHandler(), b.node_secret, 0xdeadbeefn, b.node_secret, b.logger, ignorer.as_CustomMessageHandler());
 
        var sock_b: ldk.SocketDescriptor;
        const sock_a = ldk.SocketDescriptor.new_impl({