From: Matt Corallo Date: Mon, 1 Mar 2021 17:40:56 +0000 (-0500) Subject: Update tests to latest upstream changes (ChannelKeys rename, mostly) X-Git-Tag: v0.0.98~13^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=d717c54e35f8f3c7ca39ffa2b9add818f889ff87;p=ldk-java Update tests to latest upstream changes (ChannelKeys rename, mostly) --- diff --git a/src/test/java/org/ldk/HumanObjectPeerTest.java b/src/test/java/org/ldk/HumanObjectPeerTest.java index aa79ca6b..548d5e2b 100644 --- a/src/test/java/org/ldk/HumanObjectPeerTest.java +++ b/src/test/java/org/ldk/HumanObjectPeerTest.java @@ -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 key_derivation_params() { - return new TwoTuple((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 { diff --git a/src/test/java/org/ldk/ManualMsgHandlingPeerTest.java b/src/test/java/org/ldk/ManualMsgHandlingPeerTest.java index af6b1f81..c1d6a5e3 100644 --- a/src/test/java/org/ldk/ManualMsgHandlingPeerTest.java +++ b/src/test/java/org/ldk/ManualMsgHandlingPeerTest.java @@ -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) { } diff --git a/src/test/java/org/ldk/PeerTest.java b/src/test/java/org/ldk/PeerTest.java index be652d2b..c907305a 100644 --- a/src/test/java/org/ldk/PeerTest.java +++ b/src/test/java/org/ldk/PeerTest.java @@ -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);