X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FErrorAction.ts;h=ff12a1ded092d7a55610e74d05695a207b875270;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=cbdfa17e6801ccf9c7341b241583f730689e6814;hpb=22f5f4208b1f3b5542292250f1612b944f5cd7fd;p=ldk-java diff --git a/ts/structs/ErrorAction.ts b/ts/structs/ErrorAction.ts index cbdfa17e..ff12a1de 100644 --- a/ts/structs/ErrorAction.ts +++ b/ts/structs/ErrorAction.ts @@ -16,6 +16,9 @@ export default class ErrorAction extends CommonBase { if (raw_val instanceof bindings.LDKErrorAction.IgnoreError) { return new IgnoreError(this.ptr, raw_val); } + if (raw_val instanceof bindings.LDKErrorAction.IgnoreAndLog) { + return new IgnoreAndLog(this.ptr, raw_val); + } if (raw_val instanceof bindings.LDKErrorAction.SendErrorMessage) { return new SendErrorMessage(this.ptr, raw_val); } @@ -29,6 +32,7 @@ export class DisconnectPeer extends ErrorAction { super(null, ptr); const msg: number = obj.msg; const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg); + msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } } @@ -37,12 +41,61 @@ export class IgnoreError extends ErrorAction { super(null, ptr); } } +export class IgnoreAndLog extends ErrorAction { + public ignore_and_log: Level; + private constructor(ptr: number, obj: bindings.LDKErrorAction.IgnoreAndLog) { + super(null, ptr); + this.ignore_and_log = obj.ignore_and_log; + } +} export class SendErrorMessage extends ErrorAction { public msg: ErrorMessage; private constructor(ptr: number, obj: bindings.LDKErrorAction.SendErrorMessage) { super(null, ptr); const msg: number = obj.msg; const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg); + msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } +} + public number clone_ptr() { + number ret = bindings.ErrorAction_clone_ptr(this.ptr); + return ret; + } + + public ErrorAction clone() { + number ret = bindings.ErrorAction_clone(this.ptr); + ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public static ErrorAction constructor_disconnect_peer(ErrorMessage msg) { + number ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr & ~1); + ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static ErrorAction constructor_ignore_error() { + number ret = bindings.ErrorAction_ignore_error(); + ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static ErrorAction constructor_ignore_and_log(Level a) { + number ret = bindings.ErrorAction_ignore_and_log(a); + ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static ErrorAction constructor_send_error_message(ErrorMessage msg) { + number ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1); + ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + }