]> git.bitcoin.ninja Git - ldk-java/commitdiff
[C#] Drop reference to `assert` which makes building on Win hard
authorMatt Corallo <git@bluematt.me>
Thu, 9 Nov 2023 23:25:27 +0000 (23:25 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 10 Nov 2023 01:29:04 +0000 (01:29 +0000)
csharp_strings.py

index 8efb1fc7afc5094f9f6a600128916e06d75431c8..b1ae3d20e2349c9547af623411744accbc3a26b2 100644 (file)
@@ -1095,7 +1095,7 @@ public class {struct_name.replace("LDK","")} : CommonBase {{
                 fn_name = f"{struct_name}_{var.var_name}_get_{field_map.arg_name}"
                 out_c += self.c_fn_ty_pfx + field_map.c_ty + self.c_fn_name_define_pfx(fn_name, True) + self.ptr_c_ty + " ptr) {\n"
                 out_c += "\t" + struct_name + " *obj = (" + struct_name + "*)untag_ptr(ptr);\n"
-                out_c += f"\tassert(obj->tag == {struct_name}_{var.var_name});\n"
+                out_c += f"\tCHECK(obj->tag == {struct_name}_{var.var_name});\n"
                 if field_map.ret_conv is not None:
                     out_c += ("\t" + field_map.ret_conv[0].replace("\n", "\n\t"))
                     if var.tuple_variant: