]> git.bitcoin.ninja Git - ldk-java/commitdiff
Map functions on 3-tuples
authorMatt Corallo <git@bluematt.me>
Thu, 2 Dec 2021 15:31:16 +0000 (15:31 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 2 Dec 2021 18:39:19 +0000 (18:39 +0000)
genbindings.py

index d8d00158b438489fd589209e4e531b8092c6f4ba..c6d672f1510f4100ed63495294b1ebb2f1e6e5ce 100755 (executable)
@@ -410,10 +410,14 @@ with open(sys.argv[1]) as in_h, open(f"{sys.argv[2]}/bindings{consts.file_ext}",
             struct_meth = method_name.rsplit("Z", 1)[0][1:] + "Z"
             expected_struct = "LDKC" + struct_meth
             struct_meth_name = method_name[len(struct_meth) + 1:].strip("_")
-        elif method_name.startswith("C2Tuple"):
+        elif method_name.startswith("C2Tuple") or method_name.startswith("C3Tuple"):
             tuple_name = method_name.rsplit("Z", 1)[0][2:] + "Z"
-            struct_meth = "Two" + tuple_name
-            expected_struct = "LDKC2" + tuple_name
+            if method_name.startswith("C2Tuple"):
+                struct_meth = "Two" + tuple_name
+                expected_struct = "LDKC2" + tuple_name
+            else:
+                struct_meth = "Three" + tuple_name
+                expected_struct = "LDKC3" + tuple_name
             struct_meth_name = method_name[len(tuple_name) + 2:].strip("_")
         else:
             struct_meth = method_name.split("_")[0]