X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FScorer.ts;h=4c63fa031eba6d5e1f9c2f38e8609d9da437a982;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=b60d103b7ddc77955cea189fcf0cdede7ec9ee90;hpb=0d48e557e83ef085cc92c2de63b9c81c061ce78c;p=ldk-java diff --git a/ts/structs/Scorer.ts b/ts/structs/Scorer.ts index b60d103b..4c63fa03 100644 --- a/ts/structs/Scorer.ts +++ b/ts/structs/Scorer.ts @@ -18,8 +18,8 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.Scorer_free(this.ptr); } } - public static Scorer constructor_new(number base_penalty_msat) { - number ret = bindings.Scorer_new(base_penalty_msat); + public static Scorer constructor_new(number params_base_penalty_msat_arg, number params_failure_penalty_msat_arg, number params_failure_penalty_half_life_arg) { + number ret = bindings.Scorer_new(bindings.ScoringParameters_new(params_base_penalty_msat_arg, params_failure_penalty_msat_arg, params_failure_penalty_half_life_arg)); const ret_hu_conv: Scorer = new Scorer(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; @@ -39,4 +39,15 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public Uint8Array write() { + Uint8Array ret = bindings.Scorer_write(this.ptr); + return ret; + } + + public static Result_ScorerDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.Scorer_read(ser); + Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }