]> git.bitcoin.ninja Git - ldk-java/commitdiff
Update tests to latest upstream changes (ChannelKeys rename, mostly)
authorMatt Corallo <git@bluematt.me>
Mon, 1 Mar 2021 17:40:56 +0000 (12:40 -0500)
committerMatt Corallo <git@bluematt.me>
Fri, 5 Mar 2021 19:40:23 +0000 (14:40 -0500)
src/test/java/org/ldk/HumanObjectPeerTest.java
src/test/java/org/ldk/ManualMsgHandlingPeerTest.java
src/test/java/org/ldk/PeerTest.java

index aa79ca6bec459c6ee3f34ab6e52ec870b2c90831..548d5e2b7555a5ad0f56163cdd6ac4f0e1d1f6cc 100644 (file)
@@ -42,9 +42,9 @@ class HumanObjectPeerTestInstance {
                 @Override public byte[] get_shutdown_pubkey() { return underlying_if.get_shutdown_pubkey(); }
 
                 @Override
-                public ChannelKeys get_channel_keys(boolean inbound, long channel_value_satoshis) {
-                    ChannelKeys underlying_ck = underlying_if.get_channel_keys(inbound, channel_value_satoshis);
-                    ChannelKeys.ChannelKeysInterface cki = new ChannelKeys.ChannelKeysInterface() {
+                public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) {
+                    Sign underlying_ck = underlying_if.get_channel_signer(inbound, channel_value_satoshis);
+                    Sign.SignInterface si = new Sign.SignInterface() {
                         @Override
                         public byte[] get_per_commitment_point(long idx) {
                             return underlying_ck.get_per_commitment_point(idx);
@@ -56,8 +56,8 @@ class HumanObjectPeerTestInstance {
                         }
 
                         @Override
-                        public TwoTuple<Long, Long> key_derivation_params() {
-                            return new TwoTuple<Long, Long>((long)0, (long)1);
+                        public byte[] channel_keys_id() {
+                            return new byte[32];
                         }
 
                         @Override
@@ -100,8 +100,8 @@ class HumanObjectPeerTestInstance {
                             return underlying_ck.write();
                         }
                     };
-                    ChannelKeys resp = ChannelKeys.new_impl(cki, underlying_ck.get_pubkeys());
-                    must_free_objs.add(new WeakReference<>(cki));
+                    Sign resp = Sign.new_impl(si, underlying_ck.get_pubkeys());
+                    must_free_objs.add(new WeakReference<>(si));
                     must_free_objs.add(new WeakReference<>(resp));
                     must_free_objs.add(new WeakReference<>(underlying_ck));
                     return resp;
@@ -113,7 +113,7 @@ class HumanObjectPeerTestInstance {
                 }
 
                 @Override
-                public Result_ChannelKeysDecodeErrorZ read_chan_signer(byte[] reader) {
+                public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) {
                     return underlying_if.read_chan_signer(reader);
                 }
             });
@@ -228,7 +228,7 @@ class HumanObjectPeerTestInstance {
             for (byte i = 0; i < 32; i++) {
                 key_seed[i] = (byte) (i ^ seed);
             }
-            KeysManager keys = KeysManager.constructor_new(key_seed, LDKNetwork.LDKNetwork_Bitcoin, System.currentTimeMillis() / 1000, (int) (System.currentTimeMillis() * 1000));
+            KeysManager keys = KeysManager.constructor_new(key_seed, System.currentTimeMillis() / 1000, (int) (System.currentTimeMillis() * 1000));
             if (use_km_wrapper) {
                 this.keys_interface = manual_keysif(keys.as_KeysInterface());
             } else {
index af6b1f818dd47f2fb049a6f6a8468ddba0f354c9..c1d6a5e3d12c51cf5c068e8a694b99316fb7ef38 100644 (file)
@@ -37,7 +37,7 @@ public class ManualMsgHandlingPeerTest {
             }
 
             @Override
-            public void handle_shutdown(byte[] their_node_id, long msg) {
+            public void handle_shutdown(byte[] their_node_id, long their_features, long msg) {
 
             }
 
index be652d2be19d6e1768b3382a597f99694ce72f41..c907305a2d0b873aea137101d7438e82e8940dc6 100644 (file)
@@ -90,7 +90,7 @@ public class PeerTest {
 
             byte[] key_seed = new byte[32];
             for (byte i = 0; i < 32; i++) { key_seed[i] = (byte) (i ^ seed); }
-            this.keys = bindings.KeysManager_new(key_seed, LDKNetwork.LDKNetwork_Bitcoin, System.currentTimeMillis() / 1000, (int)(System.currentTimeMillis() * 1000) & 0xffffffff);
+            this.keys = bindings.KeysManager_new(key_seed, System.currentTimeMillis() / 1000, (int)(System.currentTimeMillis() * 1000) & 0xffffffff);
             this.keys_interface = bindings.KeysManager_as_KeysInterface(keys);
             this.config = bindings.UserConfig_default();
             this.chan_manager = bindings.ChannelManager_new(LDKNetwork.LDKNetwork_Bitcoin, fee_estimator, chain_monitor, tx_broadcaster, logger, keys_interface, config, 1);