]> git.bitcoin.ninja Git - ldk-java/commitdiff
Add trivial test of a route w/ Features::known, update to upstream
authorMatt Corallo <git@bluematt.me>
Mon, 1 Feb 2021 21:08:26 +0000 (16:08 -0500)
committerMatt Corallo <git@bluematt.me>
Fri, 5 Mar 2021 19:40:22 +0000 (14:40 -0500)
src/test/java/org/ldk/HumanObjectPeerTest.java

index d8d7d2ecf23347b6f48212a2b0ee9f28cbd77d8f..aa79ca6bec459c6ee3f34ab6e52ec870b2c90831 100644 (file)
@@ -113,7 +113,7 @@ class HumanObjectPeerTestInstance {
                 }
 
                 @Override
-                public Result_ChanKeySignerDecodeErrorZ read_chan_signer(byte[] reader) {
+                public Result_ChannelKeysDecodeErrorZ read_chan_signer(byte[] reader) {
                     return underlying_if.read_chan_signer(reader);
                 }
             });
@@ -531,6 +531,15 @@ class HumanObjectPeerTestInstance {
         assert payment_res instanceof Result_NonePaymentSendFailureZ.Result_NonePaymentSendFailureZ_OK;
         wait_events_processed(peer1, peer2);
 
+        RouteHop[][] hops = new RouteHop[1][1];
+        byte[] hop_pubkey = new byte[33];
+        hop_pubkey[0] = 3;
+        hop_pubkey[1] = 42;
+        hops[0][0] = RouteHop.constructor_new(hop_pubkey, NodeFeatures.constructor_known(), 42, ChannelFeatures.constructor_known(), 100, 0);
+        Route r2 = Route.constructor_new(hops);
+        payment_res = peer1.chan_manager.send_payment(r2, payment_hash, new byte[32]);
+        assert payment_res instanceof Result_NonePaymentSendFailureZ.Result_NonePaymentSendFailureZ_Err;
+
         assert peer1.get_monitor_events().length == 0;
         assert peer2.get_monitor_events().length == 0;