X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FRouteHop.ts;h=af9e0616336880c532ef2cedd274c4def631f52c;hb=17157197e31256e968128552bc8f71986110cdff;hp=3d9e3386c2603688842128fb542778444e23a85c;hpb=9e8763c71cd61d55be7c869d973524f75209a3f3;p=ldk-java diff --git a/ts/structs/RouteHop.ts b/ts/structs/RouteHop.ts index 3d9e3386..af9e0616 100644 --- a/ts/structs/RouteHop.ts +++ b/ts/structs/RouteHop.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_pubkey(Uint8Array val) { - bindings.RouteHop_set_pubkey(this.ptr, val); + bindings.RouteHop_set_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } public NodeFeatures get_node_features() { @@ -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() { @@ -79,14 +77,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static RouteHop constructor_new(Uint8Array pubkey_arg, NodeFeatures node_features_arg, number short_channel_id_arg, ChannelFeatures channel_features_arg, number fee_msat_arg, number cltv_expiry_delta_arg) { - 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); + number ret = bindings.RouteHop_new(InternalUtils.check_arr_len(pubkey_arg, 33), 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; } + public number clone_ptr() { + number ret = bindings.RouteHop_clone_ptr(this.ptr); + return ret; + } + public RouteHop clone() { number ret = bindings.RouteHop_clone(this.ptr); const ret_hu_conv: RouteHop = new RouteHop(null, ret); @@ -94,4 +95,26 @@ 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; + } + + public static Result_RouteHopDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.RouteHop_read(ser); + Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }