Support passing trait instance references from C to Java without clone or double...
[ldk-java] / ts / structs / RouteHop.ts
index 2a3044225be95e4ac3688d12ab1ef601a1472316..b3ba3d73695b8e7667bebbf0be8c9bc8401253b6 100644 (file)
@@ -36,7 +36,6 @@ import * as bindings from '../bindings' // TODO: figure out location
 
        public void set_node_features(NodeFeatures val) {
                bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(val);
        }
 
        public number get_short_channel_id() {
@@ -57,7 +56,6 @@ import * as bindings from '../bindings' // TODO: figure out location
 
        public void set_channel_features(ChannelFeatures val) {
                bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(val);
        }
 
        public number get_fee_msat() {
@@ -82,8 +80,6 @@ import * as bindings from '../bindings' // TODO: figure out location
                number ret = bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg);
                const ret_hu_conv: RouteHop = new RouteHop(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
-               ret_hu_conv.ptrs_to.add(node_features_arg);
-               ret_hu_conv.ptrs_to.add(channel_features_arg);
                return ret_hu_conv;
        }
 
@@ -94,6 +90,17 @@ import * as bindings from '../bindings' // TODO: figure out location
                return ret_hu_conv;
        }
 
+       public number hash() {
+               number ret = bindings.RouteHop_hash(this.ptr);
+               return ret;
+       }
+
+       public boolean eq(RouteHop b) {
+               boolean ret = bindings.RouteHop_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+               this.ptrs_to.add(b);
+               return ret;
+       }
+
        public Uint8Array write() {
                Uint8Array ret = bindings.RouteHop_write(this.ptr);
                return ret;