Skip to content

Commit

Permalink
Merge pull request #115 from TheBlueMatt/main
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt authored Aug 13, 2022
2 parents 13cdf8b + 63069bb commit d4ebc84
Show file tree
Hide file tree
Showing 8 changed files with 2,418 additions and 1,589 deletions.
8 changes: 7 additions & 1 deletion genbindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,13 @@ def create_getter(struct_name, field_decl, field_name, accessor, check_sfx):
owned_fn_defn = field_decl + " " + struct_name.replace("LDK", "") + "_get_" + field_name + "(" + struct_name + " *NONNULL_PTR owner)"

holds_ref = False
if field_ty.rust_obj is not None and field_ty.rust_obj.replace("LDK", "") + "_clone" in clone_fns:
if field_ty.rust_obj is not None and field_ty.rust_obj in opaque_structs:
fn_defn = owned_fn_defn
write_c("static inline " + fn_defn + "{\n")
write_c("\t" + field_ty.rust_obj + " ret = " + accessor[0] + "owner" + accessor[1] + ";\n")
write_c("\tret.is_owned = false;\n")
write_c("\treturn ret;\n")
elif field_ty.rust_obj is not None and field_ty.rust_obj.replace("LDK", "") + "_clone" in clone_fns:
fn_defn = owned_fn_defn
write_c("static inline " + fn_defn + "{\n")
if check_sfx is not None:
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/ldk/impl/bindings.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ public final static class None extends LDKCOption_u32Z {
public static native long CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(long owner);
// struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(long owner);
// struct LDKTrustedClosingTransaction *CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner);
// struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner);
public static native long CResult_TrustedClosingTransactionNoneZ_get_ok(long owner);
// void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner);
public static native void CResult_TrustedClosingTransactionNoneZ_get_err(long owner);
// struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_CommitmentTransactionDecodeErrorZ_get_ok(long owner);
// struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_CommitmentTransactionDecodeErrorZ_get_err(long owner);
// struct LDKTrustedCommitmentTransaction *CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner);
// struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner);
public static native long CResult_TrustedCommitmentTransactionNoneZ_get_ok(long owner);
// void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner);
public static native void CResult_TrustedCommitmentTransactionNoneZ_get_err(long owner);
Expand Down Expand Up @@ -734,7 +734,7 @@ public interface LDKLogger {
void log(long record);
}
public static native long LDKLogger_new(LDKLogger impl);
// struct LDKProbabilisticScorer *CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner);
// struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_ProbabilisticScorerDecodeErrorZ_get_ok(long owner);
// struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_ProbabilisticScorerDecodeErrorZ_get_err(long owner);
Expand Down Expand Up @@ -855,7 +855,7 @@ public final static class Hostname extends LDKNetAddress {
public static native long CResult_NodeInfoDecodeErrorZ_get_ok(long owner);
// struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_NodeInfoDecodeErrorZ_get_err(long owner);
// struct LDKNetworkGraph *CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner);
// struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_NetworkGraphDecodeErrorZ_get_ok(long owner);
// struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_NetworkGraphDecodeErrorZ_get_err(long owner);
Expand Down Expand Up @@ -1171,7 +1171,7 @@ public interface LDKFeeEstimator {
public static native int FeeEstimator_get_est_sat_per_1000_weight(long this_arg, ConfirmationTarget confirmation_target);
// struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner);
public static native byte[] C2Tuple_BlockHashChannelManagerZ_get_a(long owner);
// struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner);
// struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner);
public static native long C2Tuple_BlockHashChannelManagerZ_get_b(long owner);
// struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(long owner);
Expand Down Expand Up @@ -1657,7 +1657,7 @@ public final static class None extends LDKCOption_FilterZ {
}
static { LDKCOption_FilterZ.init(); }
public static native LDKCOption_FilterZ LDKCOption_FilterZ_ref_from_ptr(long ptr);
// struct LDKLockedChannelMonitor *CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner);
// struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner);
public static native long CResult_LockedChannelMonitorNoneZ_get_ok(long owner);
// void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner);
public static native void CResult_LockedChannelMonitorNoneZ_get_err(long owner);
Expand Down
Loading

0 comments on commit d4ebc84

Please sign in to comment.