6 namespace org { namespace ldk { namespace structs {
9 * Error when signing messages.
11 public class SignError : CommonBase {
12 protected SignError(object _dummy, long ptr) : base(ptr) { }
14 if (ptr != 0) { bindings.SignError_free(ptr); }
17 internal static SignError constr_from_ptr(long ptr) {
18 long raw_ty = bindings.LDKSignError_ty_from_ptr(ptr);
20 case 0: return new SignError_Signing(ptr);
21 case 1: return new SignError_Verification(ptr);
23 throw new ArgumentException("Impossible enum variant");
27 /** A SignError of type Signing */
28 public class SignError_Signing : SignError {
29 internal SignError_Signing(long ptr) : base(null, ptr) {
32 /** A SignError of type Verification */
33 public class SignError_Verification : SignError {
34 public Secp256k1Error verification;
35 internal SignError_Verification(long ptr) : base(null, ptr) {
36 this.verification = bindings.LDKSignError_Verification_get_verification(ptr);
39 internal long clone_ptr() {
40 long ret = bindings.SignError_clone_ptr(this.ptr);
46 * Creates a copy of the SignError
48 public SignError clone() {
49 long ret = bindings.SignError_clone(this.ptr);
51 if (ret >= 0 && ret <= 4096) { return null; }
52 org.ldk.structs.SignError ret_hu_conv = org.ldk.structs.SignError.constr_from_ptr(ret);
53 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
58 * Utility method to constructs a new Signing-variant SignError
60 public static SignError signing() {
61 long ret = bindings.SignError_signing();
62 if (ret >= 0 && ret <= 4096) { return null; }
63 org.ldk.structs.SignError ret_hu_conv = org.ldk.structs.SignError.constr_from_ptr(ret);
64 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
69 * Utility method to constructs a new Verification-variant SignError
71 public static SignError verification(Secp256k1Error a) {
72 long ret = bindings.SignError_verification(a);
74 if (ret >= 0 && ret <= 4096) { return null; }
75 org.ldk.structs.SignError ret_hu_conv = org.ldk.structs.SignError.constr_from_ptr(ret);
76 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };